Summary
A server-side request forgery vulnerability in the api-mcp Proxy API Endpoint allows a remote attacker to influence the destination URL used by the customAxios function. If the endpoint accepts attacker-controlled URLs without adequate validation, the server may be induced to send requests to unintended internal or external services.
Affected context
The vulnerability occurs in the Proxy API Endpoint within app/api/proxy/route.ts, where the customAxios function processes a URL supplied through an API request. Deployments may be at risk when this endpoint is remotely reachable and does not apply strict destination validation, network restrictions, or protections against access to internal address ranges.
Exploit preconditions
- Attack surface: Remotely reachable Proxy API Endpoint
- Required access: Ability to submit requests to the affected endpoint; authentication requirements depend on deployment configuration
- Trigger point: Processing of the URL argument by the
customAxiosfunction - Why exploitation is possible: Attacker-controlled URL input may cause the server to initiate requests to destinations that were not intended by the application
Why this happens
The underlying bug is insufficient validation and authorization of a user-controlled request destination. When server-side HTTP client behavior accepts an untrusted URL without enforcing an explicit destination policy, the application can become an unintended network proxy. This behavior maps to CWE-918: Server-Side Request Forgery, because attacker input influences requests originating from the vulnerable server.
Potential impact
- An attacker may probe services that are reachable from the server but not from the public internet.
- The application could expose responses from internal or cloud metadata services.
- Internal administrative APIs may be accessed if network controls permit it.
- The server's network identity could be abused to bypass destination-based trust controls.
- Sensitive information may be disclosed or internal services could be affected.
General mitigation guidance
Mitigation generally focuses on reducing trust in client-supplied destinations and enforcing a narrowly defined outbound request policy.
Common defensive patterns include:
- Allowing requests only to an explicit, minimal set of approved schemes, hosts, ports, and paths.
- Rejecting loopback, private, link-local, multicast, reserved, and metadata-service address ranges after DNS resolution.
- Revalidating destinations across redirects and preventing unexpected protocol changes.
- Separating user-facing proxy functionality from privileged internal network access.
- Applying outbound firewall and egress policies to limit reachable networks.
- Avoiding reliance on client-side URL filtering and enforcing validation on the server.
- Running the service with only the network and application privileges it requires.
How teams detect issues like this
Organizations commonly identify SSRF risks through:
- Static analysis rules that flag HTTP client calls using request parameters as URLs.
- Code review checks for missing scheme, host, port, redirect, and IP-range validation.
- Tests covering loopback, private-network, link-local, encoded, redirected, and DNS-rebinding destinations.
- Runtime monitoring of unusual outbound requests from the proxy component.
- Egress policy enforcement and alerts for connections to internal or metadata-service address ranges.
- Automated security review tools that identify user-controlled URL construction and network access patterns.

