Summary
A server-side request forgery vulnerability in mcp-use's Inspector proxy allows caller-controlled targets to determine where the server sends proxied requests. If an attacker can reach the proxy and provide a target URL, they may access loopback, link-local, private, or otherwise host-reachable services and read their responses, including through insufficiently validated redirects.
Affected context
The issue occurs in deployments using the mcp-use Inspector proxy when the destination is taken from the X-Target-URL header or the __mcp_target parameter. Risk increases when callers can reach the proxy endpoint and the server has network access to internal, loopback, link-local, or cloud-metadata addresses that are not available to the caller directly.
Exploit preconditions
- Attack surface: The mcp-use Inspector proxy endpoint
- Required access: Ability to send requests to the proxy and influence the target header or parameter
- Trigger point: Proxy processing of a caller-supplied destination URL
- Why exploitation is possible: Target hosts and resolved addresses were not adequately restricted before the request, and redirect destinations were not subjected to equivalent validation
Why this happens
The vulnerability results from treating a caller-controlled URL as an acceptable outbound destination without enforcing a network trust policy. The proxy accepted hosts that resolved to loopback, link-local, or private address ranges and did not reapply destination checks after redirects. This behavior maps to CWE-918: Server-Side Request Forgery, where an application makes network requests to attacker-influenced destinations from a trusted server environment.
Potential impact
- Internal services may be accessed from the server's network position
- Cloud metadata or other sensitive endpoints could be queried
- Responses from otherwise inaccessible systems may be disclosed
- Network segmentation controls may be bypassed
- Redirect chains could extend access to additional protected destinations
General mitigation guidance
Mitigation generally focuses on enforcing an explicit outbound destination policy for proxy requests.
Common defensive patterns include:
- Allowing only approved schemes, hosts, ports, and network destinations
- Resolving hostnames and rejecting loopback, private, link-local, and other restricted address ranges
- Rechecking the resolved destination immediately before connection establishment
- Applying the same validation to every redirect, or disabling redirects unless explicitly required
- Preferring an allowlist of known upstream services over caller-selected destinations
- Restricting the proxy process's network permissions and limiting access to sensitive internal services
- Avoiding disclosure of upstream responses or detailed connection errors when they are not required
How teams detect issues like this
Organizations can identify SSRF risks through:
- Static analysis rules for HTTP clients that accept request URLs from headers, query parameters, or request bodies
- Code review checks for unrestricted proxy targets, DNS-resolution gaps, and redirect handling
- Tests covering loopback, private, link-local, reserved, and IPv6-mapped addresses
- Network egress policies that restrict application access to internal and metadata services
- Monitoring for unusual outbound requests, DNS lookups, redirect chains, and access to internal address ranges
- Automated security review tools that flag user-controlled URLs passed to outbound request APIs

