Skip to content

AAK-MCP-AUTHZ-COVERAGE-001: MCP authorization covers tools/call and not the other handlers, one transport, or an unset principal

Severity
HIGH
Category
Trust Boundaries (trust-boundary)
Scanner
agent_audit_kit/scanners/mcp_authz_code.py
Auto-fixable
No.
SARIF name
McpAuthzCoverageGap

What it detects

A server checks scopes in its tools/call handler but not in resources/read, prompts/get or completion/complete, so it hands out through one door what it refuses at another; it runs a check on one HTTP transport and not the other; or a handler goes ahead when the principal contextvar is unset, where .get(None) is treated as allow. One shared check called from all four handlers does not fire.

How to fix

Call one shared check from every handler, on the path both transports use, and refuse when there is no principal rather than reading its absence as allowed.

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

agent-audit-kit scan . --rules AAK-MCP-AUTHZ-COVERAGE-001

Limitations

Python only, one file at a time, so handlers split across files are not compared, and a check that lives in middleware, or in required_scopes, is not seen. A check is a call named like authorize, check_scope or require_scope, a decorator of that name, or a comparison reading scopes, permissions or roles. A resource or prompt that is public on purpose is reported all the same. The transport arm reads transport == "sse" or a streamable HTTP literal with a check in its body and no else, and not transport != "stdio", since stdio has no network login to check. The contextvar arm reads a local assigned from <name>.get(None) where the name holds principal, identity, auth, user, subject, token or actor as a word. A source file over 512 KB is not read.

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-01 (Missing Authentication)

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