Summary
A server-side request forgery (SSRF) flaw in the MCP API Call endpoint of horizon921 mcpilot 0.1.0 allows attackers to control the serverBaseUrl parameter in client/src/app/api/mcp/call/route.ts.
When exploited, this can coerce the server into making arbitrary outbound HTTP requests, potentially reaching internal services or cloud metadata endpoints that are not directly accessible from the internet.
Affected context
The vulnerability arises in deployments of horizon921 mcpilot 0.1.0 that expose the MCP API Call endpoint over a network interface.
In this context, the server accepts a serverBaseUrl argument from a client request and uses it to construct outbound HTTP calls without sufficient normalization, validation, or restriction.
Environments where the mcpilot instance has network access to internal services, other backend components, or cloud infrastructure endpoints are more susceptible to impactful exploitation.
Exploit preconditions
- Attack surface: The publicly reachable MCP API Call HTTP endpoint in
client/src/app/api/mcp/call/route.ts. - Required access: Ability to send requests to the API endpoint (typically unauthenticated or low-authenticated, depending on deployment).
- Trigger point: Supplying a crafted
serverBaseUrlvalue that points to an attacker-chosen target host or URL. - Why exploitation is possible: The endpoint trusts client-provided URLs and uses them to initiate server-side HTTP requests without enforcing an allowlist, network segmentation checks, or robust URL validation, enabling SSRF.
Why this happens
This issue is a classic example of CWE-918: Server-Side Request Forgery (SSRF).
The backend uses a user-supplied parameter (serverBaseUrl) as the basis for server-initiated network calls, effectively delegating target selection to the client.
Without strict validation or an allowlist, the application cannot differentiate between legitimate external services and sensitive internal or metadata endpoints.
The insecure pattern is: "accept arbitrary URLs from clients and pass them directly into HTTP client libraries," which enables attackers to pivot the server into acting as a network proxy.
Potential impact
- May allow attackers to access internal services or admin interfaces not exposed to the internet.
- Could enable probing of internal network topology (port scanning, service discovery) from the perspective of the mcpilot server.
- Can allow access to cloud provider metadata services, potentially exposing credentials or instance configuration.
- Might facilitate data exfiltration from internal APIs that trust requests originating from the application server.
- Could serve as a stepping stone for further compromise if internal endpoints contain additional vulnerabilities.
General mitigation guidance
Mitigation should focus on constraining where the server is allowed to connect and reducing trust in user-supplied URLs:
- Prefer an explicit allowlist of approved upstream hosts or base URLs and reject any value that does not match.
- Normalize and strictly validate any URL-like input; restrict to specific schemes (e.g.,
httpsonly) and disallow IP literals, localhost ranges, and internal address spaces where possible. - Decouple client input from direct network calls by mapping user-selectable identifiers to predefined, server-side connection configurations.
- Apply network-level protections (firewall rules, service meshes, or egress controls) to prevent outbound connections to sensitive internal networks and metadata services.
- Run the mcpilot service with least-privilege network access, limiting its ability to reach unnecessary internal resources.
How teams detect issues like this
Effective detection combines code-centric and operational approaches:
- Static analysis: Look for HTTP client calls (e.g.,
fetch,axios, or equivalent) that accept full URLs derived from request parameters likeserverBaseUrlwithout allowlists or validation logic. - Code review: Flag endpoints where user-controlled data flows into outbound network requests; absence of host restrictions, scheme checks, or internal IP blocking is a red flag.
- Security testing: Use dynamic application security testing (DAST) or manual testing to send crafted URLs pointing to internal IP ranges, localhost, or known metadata endpoints and observe responses or timing.
- Logging and monitoring: Instrument outbound HTTP calls with destination logging and alert on unusual targets, such as internal RFC1918 addresses or metadata service hostnames, requested via this API.

