/

CVE-2026-39974

Severity:

HIGH RISK

(8.5)

SSRF in n8n-MCP Multi-Tenant HTTP Interface

CVE-2026-39974

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Exposure of internal network and cloud metadata via authenticated SSRF

Severity:

HIGH RISK

(8.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/czlonkowski/n8n-mcp/commit/d9d847f230923d96e0857ccecf3a4dedcc9b0096
github.comgithub.com/czlonkowski/n8n-mcp/releases/tag/v2.47.4
github.comgithub.com/czlonkowski/n8n-mcp/security/advisories/GHSA-4ggg-h7ph-26qr

Frequently asked

questions

Yes, if the n8n-MCP HTTP endpoint is exposed on a network reachable by the attacker and they possess a valid AUTH_TOKEN. The attack does not require direct network access to the internal services, only access to the MCP server itself.

The attacker must hold a valid AUTH_TOKEN that the server accepts and must be able to send crafted HTTP requests including the relevant multi-tenant headers. No additional OS-level or administrative access is required.

The most robust pattern is to restrict outbound request destinations to a curated allowlist and ensure that no user-controlled data can directly specify hosts, IPs, or full URLs, especially for internal or metadata addresses. At the same time, review response handling so that internal details are not blindly reflected back to clients.

Design any feature that performs server-side requests on behalf of users with the assumption that all user-supplied input is untrusted. Apply strict validation and allowlisting, enforce network-layer egress controls, isolate components that must reach external services, and include SSRF-specific checks in code review and automated testing policies.

Find out what's already
exploitable in your codebase.