AAK-SSRF-003: Cloud metadata endpoint reachable via MCP tool
- Severity
- CRITICAL
- Category
- MCP Configuration (
mcp-config) - Scanner
agent_audit_kit/scanners/ssrf_patterns.py- Auto-fixable
- No.
- SARIF name
SsrfCloudMetadata
What it detects
An MCP tool accepts URLs that can reach 169.254.169.254 (AWS/Azure/GCP metadata) or metadata.google.internal, allowing exfiltration of instance credentials.
How to fix
Block 169.254.0.0/16 and metadata.google.internal at the HTTP client layer. Use a deny-by-default IP allowlist.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-SSRF-003
Limitations
Reads only files that contain @tool, createTool, McpServer, FastMCP, mcp.tool, Server.run_streamable_http, BaseTool or StructuredTool, or def forward and output_type with a class on a Tool base (a smolagents tool). It recognises 169.254.169.254, in any spelling a client reads as it (http://0xa9fea9fe/) or a wildcard-DNS name embedding it (169.254.169.254.nip.io, 169-254-169-254.sslip.io, a9fea9fe.nip.io), and metadata.google.internal only. A name that resolves there with nothing in the name to say so needs a lookup, which a scan does not do. In Python the address reaches the call through up to four names, each looked up across the whole file rather than in the call's own function, so a base another function binds is read as the handler's, and only through = and annotated = bindings, so an address a for loop, +=, := or tuple unpacking binds is missed. Other cloud credential endpoints (169.254.170.2, 100.100.100.200) are not matched, and a file gets one finding, for the first matching call (in ast.walk order in Python), so a metadata fetch that follows a loopback fetch is reported as AAK-SSRF-002 alone.
References
- OWASP MCP Top 10: MCP05:2025 (Command Injection & Execution)
- OWASP Agentic Top 10: ASI02 (Tool Misuse and Exploitation)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-SSRF-03
- CSA AI Controls Matrix (AICM): IVS-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-SSRF-003.md: the page then shows that text, with the registry reference appended under it.