Skip to content

AAK-MCP-014: Auth token transmitted via URL query parameter

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

What it detects

An MCP client or server expects authentication tokens in URL query parameters. Query parameters land in server access logs, browser history, and referer headers, making this a token-leak vector.

How to fix

Pass tokens in the Authorization header, never in query params.

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

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

Limitations

Looks for ?token=-style text, query_params.get("token") and req.query.token with the names access_token, api_key, token, auth or bearer. Other ways to read a credential from the query string, new URL(req.url).searchParams.get("token") or Flask's request.args.get("token"), are not matched.

References

  • OWASP MCP Top 10: MCP01:2025 (Token Mismanagement & Secret Exposure)
  • OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse)
  • Adversa AI MCP Top 25 (AAK-defined ids): ADV-AUTH-04

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