Summary
An authenticated server-side request forgery (SSRF) vulnerability in n8n-MCP prior to version 2.47.4 allows a caller with a valid AUTH_TOKEN to make the server issue HTTP requests to attacker-controlled URLs via multi-tenant HTTP headers.
Because response bodies are reflected back over JSON-RPC, an attacker can read sensitive resources accessible from the server's network, including cloud metadata endpoints and internal services, in affected multi-tenant HTTP deployments.
Affected context
The vulnerability occurs in n8n-MCP deployments that:
- Expose the MCP server over HTTP (not just stdio)
- Enable and rely on multi-tenant HTTP headers to route or identify tenants
- Allow more than one operator or client to use a valid AUTH_TOKEN, or share a token with less-trusted clients
In these conditions, authenticated users can influence how outbound HTTP requests are constructed so that n8n-MCP connects to arbitrary URLs, and then returns the full response body via JSON-RPC.
Exploit preconditions
- Attack surface: n8n-MCP HTTP endpoint with multi-tenant headers enabled.
- Required access: A valid AUTH_TOKEN and the ability to send crafted HTTP requests that include specific multi-tenant headers and target URLs.
- Trigger point: Invoking MCP functionality that causes the server to perform outbound HTTP requests based on header-supplied or otherwise controllable URL targets.
- Why exploitation is possible: The server implicitly trusts tenant-related HTTP headers and uses them to construct outbound requests without sufficiently constraining destination addresses or schemes, while also returning raw response bodies to the caller over JSON-RPC.
Why this happens
This issue stems from the server treating certain HTTP header values in a multi-tenant configuration as trusted inputs to outbound HTTP requests.
Instead of restricting which hosts or URL patterns the server can access on behalf of a tenant, the implementation allows user-controlled values to influence destination URLs.
Because the server sits within a privileged network environment and has access to cloud instance metadata services and internal hosts, the behavior maps directly to CWE-918: Server-Side Request Forgery (SSRF): untrusted user input is used to craft server-side requests, and the responses are exposed back to the attacker.
Potential impact
- Access to cloud instance metadata services (AWS IMDS, GCP, Azure, Alibaba, Oracle), which could lead to credential and token exposure.
- Discovery and probing of internal network services that are not directly internet-facing.
- Retrieval of configuration files or service endpoints accessible only from the n8n-MCP host's network.
- Use of the server as a pivot point for further attacks within the internal environment (e.g., mapping internal IP ranges and services).
- Potential exposure of sensitive data returned by internal APIs or admin interfaces the server can reach.
General mitigation guidance
Effective mitigation focuses on strictly controlling how outbound requests are constructed and what the server is allowed to reach:
- Introduce allowlists or tightly scoped rules for outbound destinations, limiting requests to known, external, and non-sensitive hosts.
- Treat all tenant-identifying headers and URL components as untrusted input, validating and normalizing them before use, and blocking internal IP ranges, link-local addresses, and cloud metadata endpoints.
- Separate network access for MCP functionality from sensitive infrastructure where feasible, for example by placing MCP instances in segmented networks with minimal reachability.
- Avoid sharing AUTH_TOKENs across trust boundaries; instead, use distinct tokens per tenant or client with clear isolation and least privilege.
- Ensure responses from any remaining dynamic outbound requests are filtered or minimized so that sensitive internal details are not reflected back to end users.
How teams detect issues like this
Detection can combine code-level and runtime approaches:
- Static analysis and code review: Search for code paths where HTTP headers or other request-sourced data are used to form outbound URLs or hostnames. Flag locations where destination addresses are not validated against an allowlist or are missing checks for internal ranges and metadata endpoints.
- Configuration and policy checks: Enforce policies that require network egress controls and domain/IP allowlists for any component that performs dynamic HTTP requests on behalf of users.
- Runtime monitoring: Inspect outbound traffic from n8n-MCP instances for unusual targets, such as link-local IPs (e.g., 169.254.169.254), RFC1918 ranges, or internal hostnames not expected in normal operation.
- Log analysis: Analyze application and network logs for repeated requests to internal or metadata endpoints initiated via MCP interactions, which may indicate attempted or successful SSRF exploitation.

