Skip to content

AAK-MCP-001: Remote MCP server without authentication

Severity
CRITICAL
Category
MCP Configuration (mcp-config)
Scanner
agent_audit_kit/scanners/mcp_config.py
Auto-fixable
No.
SARIF name
RemoteMcpServerNoAuth

What it detects

An MCP server uses HTTP transport (url field) without a recognized authentication or access-control header. Recognized schemes are Authorization / Bearer, X-API-Key / Api-Key, the custom credential-header family (X-*-Key, *-API-Key, *_API_KEY, *-Subscription-Key and similar), and the x402 X-PAYMENT gate, declared via an env/template reference (e.g. ${API_KEY}). A custom auth header carrying a hardcoded literal secret still fires — the credential is exposed in the config, so the endpoint is effectively unprotected. A server on a loopback host (localhost, 127.0.0.0/8, ::1, 0.0.0.0) is not reported. Unauthenticated remote servers can be MITM'd or spoofed.

How to fix

Add OAuth 2.1 bearer token or API key header authentication (reference the secret via an env var, do not hardcode it in the config).

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-MCP-001

Limitations

Reads the url field of each server in mcpServers, or servers in VS Code's .vscode/mcp.json, and looks for an Authorization, Bearer, X-API-Key or API-Key header, or for one of a fixed family of custom credential headers (X-*-Key, X-*-Token but not X-CSRF-Token or X-XSRF-Token, X-*-Secret, a name ending in -API-Key, _API_KEY or ApiKey, *-API-Token, *-Access-Key, *-Client-Secret, *-Subscription-Key, X-Auth-Token, X-Access-Token, X-Payment) whose value is empty or blank, or contains a ${VAR}, $VAR, {{VAR}}, <VAR> or %VAR% reference, your, change-me (also change_me and change me), changeme, placeholder, redacted, dummy or four x's anywhere, _here at the end of a word, or example or sample as a whole word (an underscore joins words, so example_key does not count); "X-Foo-Key": "" and "k9f2-example-77a1" both count as a declared scheme. A remote URL given any other way is not examined: as an argument to a bridge (npx mcp-remote https://...) or under another key such as serverUrl. A server on a loopback host (localhost, 127.0.0.0/8, ::1 or 0.0.0.0) is not reported, though one that checks no Origin header can still be reached from a web page through DNS rebinding. A URL that Node, requests and Rust's url crate read differently from curl, httpx and urlsplit, which keep a backslash inside the authority, is judged by the less safe of the two readings, so http://localhost\@evil.example/, which curl and httpx send to evil.example, is reported.

References

  • OWASP MCP Top 10: MCP07:2025 (Insufficient Authentication & Authorization)
  • OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse)
  • Adversa AI MCP Top 25 (AAK-defined ids): ADV-AUTH-01 (Missing Authentication)

All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-MCP-001.md: the page then shows that text, with the registry reference appended under it.