Summary
auth-fetch-mcp contains a server-side request forgery (SSRF) protection bypass in its URL validation logic. An attacker who can supply a URL to the MCP server may use an IPv4-mapped IPv6 loopback address to reach services on the local host that should be inaccessible.
Affected context
The vulnerability occurs in auth-fetch-mcp deployments that use the affected URL validation path before passing user-controlled URLs to a browser or HTTP client. The risk is present when an attacker can influence a URL fetched by the MCP tool and the target environment exposes services on loopback or otherwise restricted network addresses.
Exploit preconditions
- Attack surface: MCP content-fetching functionality that accepts attacker-influenced URLs
- Required access: Ability to invoke the relevant MCP tool or cause it to process a supplied URL
- Trigger point: URL validation before the request is sent to the browser or HTTP client
- Why exploitation is possible: IPv4-mapped IPv6 loopback addresses can be normalized into hexadecimal form, causing the private-address check to misclassify them as non-IPv4 and allow the request
Why this happens
The root cause is incomplete canonicalization and validation of IPv4-mapped IPv6 addresses. The isPrivateV6() logic relies on an IPv4 check that does not recognize the URL parser's hex-normalized representation of a mapped loopback address. This behavior maps to CWE-918: Server-Side Request Forgery, because attacker-controlled network destinations are insufficiently restricted before the server initiates a request.
Potential impact
- An attacker may access loopback-only administrative or diagnostic services
- The MCP server could expose responses from internal network endpoints
- Credentials, tokens, or service metadata may be disclosed
- Internal services could be targeted through the trusted server network position
- Further compromise may be possible if an accessible internal service has additional weaknesses
General mitigation guidance
Mitigation typically focuses on canonicalizing addresses before applying network restrictions and enforcing deny-by-default egress policy.
Common defensive patterns include:
- Parse and normalize IPv4, IPv6, and IPv4-mapped IPv6 addresses consistently before validation
- Apply private, loopback, link-local, multicast, and unspecified-address checks after canonicalization
- Resolve hostnames and validate every resulting address, including redirects and alternate address families
- Restrict outbound requests with network-level egress controls in addition to application checks
- Use allowlists for approved schemes, hosts, ports, and destinations where feasible
- Prefer vendor-maintained releases containing the relevant security correction
- Run the MCP service with least-privilege network and operating-system permissions
How teams detect issues like this
Organizations can detect similar SSRF bypasses through:
- Static analysis and code review of URL validation, IP parsing, redirect handling, and DNS resolution logic
- Test cases covering IPv4, IPv6, IPv4-mapped IPv6, hexadecimal, decimal, and alternate textual address forms
- Dynamic testing that verifies requests to loopback, private, link-local, and cloud metadata destinations are denied
- Network telemetry monitoring unexpected outbound requests to local or restricted address ranges
- Policy enforcement that limits permitted egress destinations independently of application-layer validation
- Automated security review tools that flag user-controlled URLs passed to HTTP clients or browser automation

