Skip to content

AAK-OAUTH-004: Wildcard or overly-broad redirect_uri

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

What it detects

An OAuth client registers a wildcard, localhost-with-any-port, or overly-broad redirect_uri. Attackers can hijack authorization codes via dangling subdomains or open redirectors.

How to fix

Register exact-match redirect URIs only. No wildcards.

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

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

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 redirect_uri or redirect_uris value of * or ["*"], one that begins with https://* or http://*, or one that begins with http://localhost. A wildcard URL inside a list (["https://*.example.com/callback"]), a trailing wildcard ("https://app.example.com/*") and 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-004.md: the page then shows that text, with the registry reference appended under it.