Skip to content

AAK-MCP-TRANSPORT-SESSION-UNAUTH-001: MCP HTTP transport binds every interface and authenticates no caller

Severity
CRITICAL
Category
Transport Security (transport-security)
Scanner
agent_audit_kit/scanners/mcp_transport_session_unauth.py
Auto-fixable
No.
SARIF name
McpTransportSessionUnauth

What it detects

An MCP server exposes an HTTP/SSE transport on every network interface and creates sessions without requiring a caller credential. A credential is present — read from the environment and attached to the server's own upstream requests — but it authenticates the server to its backend, not the caller to the server, so any host that can reach the listener invokes the full tool surface with the operator's stored token. The bind is often implicit: in Node, .listen(port) with the host argument omitted binds every interface with no 0.0.0.0 literal anywhere in the source.

How to fix

Require a separate inbound credential for network transports, and treat environment tokens as outbound-only — never as proof of a caller's identity. Bind 127.0.0.1 by default, and set enableDnsRebindingProtection: true with allowedHosts / allowedOrigins on each transport (or use the SDK's hostHeaderValidation() middleware).

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

agent-audit-kit scan . --rules AAK-MCP-TRANSPORT-SESSION-UNAUTH-001

Limitations

Reads one file at a time, so an inbound check applied from a separate middleware module is not seen. The implicit all-interfaces bind is inferred for JS/TS only, where Node's listen() defaults to every interface; Python servers default to loopback and are never inferred.

References


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-TRANSPORT-SESSION-UNAUTH-001.md: the page then shows that text, with the registry reference appended under it.