Skip to content

AAK-OAUTH-003: OAuth token passthrough between tenants

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

What it detects

An MCP server receives a bearer token from one identity and forwards it to a downstream service without re-minting. This is the 'confused deputy' shape banned by OAuth 2.1 BCPs.

How to fix

Use token-exchange (RFC 8693) or a service account to call downstream services. Never forward a user token across trust boundaries.

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

agent-audit-kit scan . --rules AAK-OAUTH-003

Limitations

Examines only files that contain a word starting with oauth, authorization_endpoint, token_endpoint or client_id (in any case; GOOGLE_CLIENT_ID does not count) or the call authorize(. In them it matches a dict entry "Authorization": request.headers[...] (quoted key, header read by subscript; also req, event, input) and any assignment headers["Authorization"] = request..... A dict entry read with .get or as a property (req.headers.authorization), one with an unquoted key ({ Authorization: req.headers["authorization"] }), and the same forwarding in a file with none of those words, are not matched.

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