Skip to content

AAK-SSRF-005: Missing SSRF allowlist on outbound fetch

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

What it detects

An MCP tool performs outbound HTTP but has no allowlist of permitted destinations. Deny-by-default with an explicit allowlist is the only reliable defense against SSRF chains.

How to fix

Check the URL's host against an explicit allowlist before the request and reject any other host. Keep the list in a variable this check recognises: ALLOWED_HOSTS, ALLOWED_HOST, ALLOW_HOSTS, ALLOW_HOST, URL_ALLOW_LIST, allowed_hosts or allowlist; a list under another name is not seen.

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

agent-audit-kit scan . --rules AAK-SSRF-005

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 fires on a recognised fetch call whose URL caller input reaches, read as AAK-SSRF-001 reads it, in a file that never writes ALLOW_HOST, ALLOW_HOSTS, ALLOWED_HOST, ALLOWED_HOSTS or URL_ALLOW_LIST (upper case), allowed_hosts = or allowlist = (lower case). Declaring one of those names is enough: nothing checks that the list is applied to the URL.

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