Skip to content

AAK-OAUTH-001: OAuth flow without PKCE

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

What it detects

An OAuth 2.1 client flow does not use PKCE. PKCE is mandatory for all MCP remote server clients per spec 2025-11-25, including confidential clients.

How to fix

Add a code_verifier/code_challenge pair to every authorization request. Use code_challenge_method=S256.

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

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

Limitations

Fires on a call to authorize( or the name authorization_endpoint in a file that has no whole word code_verifier or pkce and no code_challenge outside code_challenge_method. An authorization URL written out as a literal (https://auth.example.com/authorize?response_type=code) is not recognised as an authorization request.

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