HIGH AI PREVALENCE: HIGH auth.mcp.tool-handler-ssrf
An argument of an MCP tool handler (server.registerTool / server.tool) flows into an outbound HTTP request without validation, a server-side request forgery (SSRF, CWE-918).
Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Why this matters
Tool arguments are attacker-influenced: an LLM or a malicious caller can point the URL at internal services, cloud metadata (169.254.169.254), or localhost. BlueRock found ~36.7% of MCP servers SSRF-prone.
Validate the target before fetching: resolve and allow-list the host, reject private/link-local ranges, and disable redirects. Never pass a raw tool argument straight into fetch/axios.
VULNERABLE
SAFE
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.mcp.tool-handler-ssrf -- <reason>