Skip to content

AAK-MCP-ROUTING-DESYNC-001: MCP routable header (Mcp-Method/Mcp-Name) trusted without body cross-check

Severity
HIGH
Category
Transport Security (transport-security)
Scanner
agent_audit_kit/scanners/mcp_routing_desync.py
Auto-fixable
No.
SARIF name
McpRoutableHeaderBodyDesync

What it detects

The 2026-07-28 spec (SEP-2243) adds routable request-metadata headers — Mcp-Method and Mcp-Name — so proxies can route and pre-authorize a JSON-RPC call from the HTTP header. This server/proxy makes a routing or authorization decision from that header but never cross-checks it against the authoritative JSON-RPC body method/name. A caller can set Mcp-Method: tools/list (allowed at the gateway) while the body invokes tools/call on a privileged tool — a header/body desync that smuggles the real call past the gate (confused-deputy). A flow that asserts the header equals the body method does not fire.

How to fix

Never authorize or route on Mcp-Method/Mcp-Name alone. Parse the JSON-RPC body and reject the request unless the routable header equals the body method/tool name; apply the security decision to the body.

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

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

Limitations

Fires on a file that reads the Mcp-Method or Mcp-Name header and uses routing or allow-list words, unless the file also reads the JSON-RPC body's method (body.get("method"), payload["method"]). Any such read counts as the cross-check, including one that only logs the value and never compares it to the header.

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