Skip to content

AAK-MCP-013: Wildcard CORS on MCP endpoint

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

What it detects

An MCP HTTP endpoint sets Access-Control-Allow-Origin to '*' while also returning credentials/tokens. This allows hostile origins to read MCP responses from a victim browser session.

How to fix

Restrict CORS to an explicit origin allowlist. Never combine '*' with Access-Control-Allow-Credentials: true.

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

agent-audit-kit scan . --rules AAK-MCP-013

Limitations

Looks in one file for the header name Access-Control-Allow-Origin followed by a quoted "*" and the name Access-Control-Allow-Credentials followed by true. The usual framework options (CORSMiddleware(..., allow_origins=["*"], allow_credentials=True), cors({ origin: "*", credentials: true })) do not contain those names and are not matched.

References

  • OWASP MCP Top 10: MCP07:2025 (Insufficient Authentication & Authorization)
  • OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse)
  • Adversa AI MCP Top 25 (AAK-defined ids): ADV-AUTH-03

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