Skip to content

AAK-OAUTH-006: OAuth client does not validate the iss authorization-response parameter (RFC 9207)

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

What it detects

An OAuth authorization-code client processes the authorization response / redirect callback (reads code and state, or exchanges the code at the token endpoint) but never references the iss parameter. The MCP ratified 2026-07-28 spec (SEP-2468) requires clients to validate iss on authorization responses per RFC 9207 — without it, an attacker who controls one authorization server in MCP's single-client / many-server deployment can mount an OAuth mix-up attack and have the client redeem a code at the wrong server. This is the token-issuer-validation arm of the 2026-07-28 final MCP auth profile (scanned together with RFC 8707 resource indicators, AAK-OAUTH-007, and RFC 9728 Protected-Resource-Metadata discovery, AAK-OAUTH-008, via --profile mcp-2026-07-28). A later spec version will require rejecting responses that omit iss entirely.

How to fix

Validate the iss authorization-response parameter against the expected issuer of the authorization server the request was sent to (RFC 9207), and reject the response on mismatch. Have your authorization server emit iss now so the check can be enforced before the 2026-07-28 cutover.

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

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

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 fires on a code exchange (grant_type=authorization_code, exchange_code_for_token, or a read of code from the query arguments) when the word iss appears nowhere in the file. Any iss counts as validating the authorization response, including a JWT claim check on the ID token (claims["iss"]), and the same exchange in a file with none of those words is not reported.

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