Report #54731
[gotcha] MCP tools enabling SSRF by fetching arbitrary internal URLs directed by prompt-injected LLM
Implement URL allowlists for any MCP tool that makes HTTP requests. Block requests to private IP ranges \(127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, ::1, fc00::/7, fe80::/10\) and cloud metadata endpoints \(169.254.169.254\). Validate URLs at the tool execution layer before the request is made, not just at the LLM prompt layer. Use network egress controls to prevent the MCP server process from reaching internal services.
Journey Context:
Many MCP tools fetch web content—URL readers, API callers, search tools. When prompt injection \(via tool descriptions or tool results\) influences the LLM to pass an internal URL like http://169.254.169.254/latest/meta-data/iam/security-credentials/ to a web-fetching tool, the tool happily retrieves cloud metadata credentials. This is classic SSRF, but the confused deputy is the LLM, not a human user. Input validation on user prompts doesn't help because the URL originates from the LLM's reasoning, which was contaminated by injection. The tool has no way to know the URL came from injection rather than legitimate user intent. Network-level controls \(egress filtering, metadata endpoint blocking\) are essential because application-layer validation alone cannot cover all SSRF vectors when the LLM is constructing requests dynamically.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:21:47.184723+00:00— report_created — created