CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-4GGG-H7PH-26QR
8.8

GHSA-4GGG-H7PH-26QR: Authenticated Server-Side Request Forgery in n8n-mcp Multi-Tenant Mode

Alon Barad
Alon Barad
Software Engineer

Apr 9, 2026·7 min read·3 visits

PoC Available

Executive Summary (TL;DR)

Authenticated attackers can exploit an SSRF in n8n-mcp (< 2.47.4) via the x-n8n-url header to read internal network services and cloud metadata.

A high-severity Server-Side Request Forgery (SSRF) vulnerability exists in the n8n-mcp npm package prior to version 2.47.4. The flaw allows authenticated attackers to manipulate HTTP headers in multi-tenant mode, forcing the server to make unauthorized outbound requests to internal network resources and cloud provider metadata endpoints.

Vulnerability Overview

The n8n-mcp npm package provides an integration layer between n8n workflow automation and the Model Context Protocol (MCP). The software operates a server component that can function in a multi-tenant HTTP mode. This mode dynamically routes requests to specific n8n instances based on client-provided configuration.

The vulnerability exists within this multi-tenant routing logic. The server extracts instance location data directly from the x-n8n-url HTTP header supplied by the client. It then uses this extracted value as the base URL for backend API calls without performing adequate validation or sanitization on the destination address.

Because the MCP server acts as an intermediary bridge, it reflects the response bodies obtained from these backend requests back to the client via JSON-RPC. This configuration transforms a standard request routing mechanism into a Full Server-Side Request Forgery (SSRF) condition. Authenticated attackers can supply arbitrary URLs and read the resulting response data.

The vulnerability is tracked as GHSA-4GGG-H7PH-26QR and is classified as CWE-918. Successful exploitation requires the attacker to possess valid credentials for the MCP server. The primary impact involves unauthorized information disclosure from internal network segments and contiguous cloud infrastructure.

Root Cause Analysis

The root cause of this vulnerability lies in the improper handling of user-controlled input within the server's network request initialization phase. In multi-tenant mode, clients specify their target n8n instance URL and API key using custom HTTP headers. The system extracts the x-n8n-url value to determine where subsequent operational data should be sent.

Prior to version 2.47.4, the application passed this raw header value directly into the baseURL parameter of an axios HTTP client instance. The code lacked structural validation to restrict the hostname, IP address, or port of the provided URL. The server blindly trusted the client-supplied destination.

The absence of specific validation mechanisms means the server evaluates all valid URI formats equally. An attacker can substitute the expected n8n instance URL with an IP address corresponding to a local loopback interface (127.0.0.1), a private network range (RFC1918), or a cloud provider's link-local metadata service. The axios client successfully resolves these addresses and executes the HTTP requests.

Following the execution of the backend request, the MCP server packages the HTTP response payload into a JSON-RPC message. This message is then transmitted back to the original client. This specific architecture upgrades the vulnerability from a blind SSRF, where an attacker only infers success via timing or error states, to a full SSRF where the attacker obtains the complete contents of the internal resource.

Code Analysis

The remediation implemented in commit d9d847f230923d96e0857ccecf3a4dedcc9b0096 introduces a dedicated SSRFProtection utility class. This class provides both synchronous and asynchronous validation methods to rigorously inspect user-supplied URLs before they reach the HTTP client component. The synchronous checks perform initial sanitization and format validation.

static validateUrlSync(urlString: string): { valid: boolean; reason?: string } {
    if (typeof urlString !== 'string' || urlString.includes('#')) {
      return { valid: false, reason: 'URL fragments are not allowed' };
    }
    let url: URL;
    try {
      url = new URL(urlString);
    } catch {
      return { valid: false, reason: 'Invalid URL format' };
    }
    if (!['http:', 'https:'].includes(url.protocol)) {
      return { valid: false, reason: 'Invalid protocol. Only HTTP/HTTPS allowed.' };
    }
    if (url.username !== '' || url.password !== '') {
      return { valid: false, reason: 'Userinfo in URL is not allowed' };
    }
    // Additional checks for private IPs and Cloud Metadata omitted for brevity
}

The code block above demonstrates the new validateUrlSync method. It explicitly rejects URL fragments, restricts protocols to HTTP and HTTPS, and prevents the inclusion of embedded credentials via the userinfo component. Subsequent lines in the patched file introduce hardcoded blocklists for loopback addresses and the 169.254.169.254 cloud metadata endpoint.

To address bypass techniques involving DNS rebinding or custom hostnames resolving to internal IPs, the patch includes an asynchronous validateWebhookUrl method. This function performs explicit DNS resolution on the hostname before initiating the request. If the resolved IP address falls within a restricted range, the server aborts the connection attempt.

The SingleSessionHTTPServer component integrates these validation routines by invoking validateInstanceContext immediately after parsing the headers. If the URL fails either the synchronous format checks or the asynchronous DNS resolution constraints, the server terminates the transaction and returns a 400 Bad Request HTTP status code.

Exploitation Methodology

Exploiting this vulnerability requires the attacker to possess valid authentication credentials for the n8n-mcp server. The server must also be operating in the vulnerable multi-tenant HTTP mode. With these prerequisites met, the attacker crafts a standard request to the MCP service.

The core of the exploit involves manipulating the HTTP headers sent during the initial connection. The attacker modifies the x-n8n-url header, replacing a legitimate n8n instance URL with a target internal endpoint. A common exploitation target is a cloud provider metadata service, accessed via http://169.254.169.254/latest/meta-data/.

The attacker provides a syntactically valid but functionally arbitrary value for the x-n8n-key header to satisfy basic input requirements. Upon receiving the crafted request, the n8n-mcp server extracts the malicious URL and executes an outbound HTTP GET request to the specified internal address. The server processes the metadata service's response.

The server subsequently wraps the retrieved internal data within its standard JSON-RPC response format and transmits it back to the attacker. The attacker receives the full text of the cloud metadata response. Repeating this process allows the attacker to traverse the metadata directory structure and extract temporary identity tokens or instance profiles.

Impact Assessment

The primary consequence of this vulnerability is the unauthorized disclosure of sensitive information from restricted network environments. Because the SSRF execution reflects the full response body, attackers can comprehensively map internal network services. They can identify open ports, retrieve internal application banners, and interact with unauthenticated internal administrative interfaces.

The most severe impact materializes when the vulnerable n8n-mcp server is hosted within a cloud infrastructure environment. Attackers can explicitly target the cloud provider metadata endpoints (e.g., AWS IMDS, Azure Instance Metadata Service, GCP Metadata Server). These endpoints often provide sensitive operational data without requiring authentication from the local instance.

By querying specific metadata paths, attackers can extract temporary security credentials assigned to the host instance. If the compromised instance profile possesses elevated Identity and Access Management (IAM) permissions, the attacker can use those credentials to authenticate directly to the cloud provider's API. This facilitates lateral movement and potential escalation of privileges across the broader cloud environment.

The requirement for initial authentication limits the exposure strictly to authorized tenants of the MCP server. However, in environments where tenant isolation is expected to prevent access to underlying infrastructure, this vulnerability completely undermines that boundary. The impact remains high due to the potential compromise of foundational infrastructure credentials.

Remediation and Mitigation

The definitive remediation for this vulnerability requires upgrading the n8n-mcp package to version 2.47.4 or later. This release incorporates the SSRFProtection module, which effectively neutralizes the attack vector by validating URLs and performing mandatory DNS resolution checks. Administrators must ensure all instances of the application are updated and restarted.

If an immediate software upgrade is not operationally feasible, administrators can apply architectural workarounds. Disabling the multi-tenant HTTP mode entirely removes the vulnerable code path from execution. This configuration forces the server to rely on static, pre-configured instance URLs that clients cannot manipulate via HTTP headers.

Network-level controls provide a defense-in-depth mitigation strategy. Organizations should implement strict egress filtering rules on the host operating the n8n-mcp server. Firewall rules must explicitly deny outbound connections to cloud metadata IP addresses (169.254.169.254) and restrict general internet access to only trusted n8n instance destinations.

Security teams should monitor application and network logs for indicators of compromise. The patched version of the software emits specific log warnings, such as SSRF protection blocked instance context URL, when a blocked request is detected. Additionally, auditing VPC flow logs for unexpected outbound traffic from the MCP server to RFC1918 address space will assist in identifying exploitation attempts.

Official Patches

czlonkowskiPatch commit introducing SSRF protection
czlonkowskiRelease v2.47.4 containing the fix

Fix Analysis (1)

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Affected Systems

n8n-mcp npm package (< 2.47.4)

Affected Versions Detail

Product
Affected Versions
Fixed Version
n8n-mcp
czlonkowski
< 2.47.42.47.4
AttributeDetail
CWE IDCWE-918
Attack VectorNetwork
Privileges RequiredLow (Authenticated)
CVSS Score8.8
ImpactInformation Disclosure, Credential Exfiltration
Exploit StatusProof of Concept

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1552.005Cloud Instance Metadata API
Credential Access
CWE-918
Server-Side Request Forgery (SSRF)

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

Vulnerability Timeline

Vulnerability reported by Eresus Security Research Team
2026-04-08
Fix committed and released in version 2.47.4
2026-04-08
Advisory GHSA-4GGG-H7PH-26QR published
2026-04-08

References & Sources

  • [1]GitHub Security Advisory GHSA-4GGG-H7PH-26QR
  • [2]Fix Commit
  • [3]Release 2.47.4

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.