Summary
Heym's MCP tool-fetch endpoint allows an authenticated user to make the server issue requests to a URL they supply. Without restrictions on destinations, schemes, redirects, or request headers, this may expose internal services to requests and provide a semi-blind signal through reflected transport errors.
Affected context
The issue concerns Heym's POST /api/mcp/fetch-tools endpoint and its sse and streamable_http transports. It is relevant where the endpoint is reachable by authenticated users and the server fetches user-supplied URLs without destination and redirect controls. The description identifies affected versions prior to 0.0.70.
Exploit preconditions
- Attack surface: The MCP tool-fetch API endpoint.
- Required access: Any authenticated user; admin privileges or workflow association are not required.
- Trigger point: A request to the endpoint that causes an
sseorstreamable_httptransport to fetch a supplied URL. - Why exploitation is possible: The fetch path lacks scheme, private-IP, allowlist, and redirect guards; users also control outbound request headers. Transport errors reflected in HTTP 422 responses can provide a semi-blind oracle.
Why this happens
The server makes outbound requests using a destination and headers controlled by the caller without adequately validating or constraining them. This is a server-side request forgery weakness, mapped to CWE-918, because an attacker can influence requests made from the vulnerable server to other resources.
Potential impact
- The server may be induced to send requests to reachable internal services.
- Responses or transport errors could disclose information about reachable resources or request outcomes.
- Attacker-controlled headers could influence how destination services handle requests.
- Depending on network reachability and the behavior of contacted services, requests could cause unintended actions.
General mitigation guidance
Common defensive patterns for outbound-fetch functionality include:
- Allow only explicitly approved URL schemes, hosts, and destinations.
- Resolve and validate destination addresses, including private and otherwise restricted ranges, and re-check destinations after redirects.
- Disable redirects by default or validate every redirect target against the same policy.
- Construct outbound headers from a constrained set rather than passing through caller-controlled headers.
- Return generic transport errors that do not reveal useful details about destination behavior.
- Limit the endpoint to the minimum necessary user roles and run the service with restricted network access.
How teams detect issues like this
- Review outbound HTTP clients and transport code for requests built from caller-supplied URLs or headers.
- Use static analysis or code review checks to flag URL fetches without scheme, destination, and redirect validation.
- Monitor requests from the service to private, link-local, or otherwise unexpected address ranges.
- Enforce egress policies that limit which hosts and network segments the application can contact.
- Examine API error handling for detailed transport failures reflected to callers.

