Apr 9, 2026·7 min read·34 visits
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.
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.
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.
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.
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.
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.
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.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
n8n-mcp czlonkowski | < 2.47.4 | 2.47.4 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-918 |
| Attack Vector | Network |
| Privileges Required | Low (Authenticated) |
| CVSS Score | 8.8 |
| Impact | Information Disclosure, Credential Exfiltration |
| Exploit Status | Proof of Concept |
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.
A critical stored Cross-Site Scripting (XSS) vulnerability was identified in Froxlor server administration software panel before version 2.3.8. Authenticated customers with DNS editor privileges can inject malicious JavaScript into DNS TXT records. Because the application processes these values via a raw formatting callback without context-aware HTML entity encoding, the payload executes in the security context of administrative users who view the affected domain's DNS zones.
An authenticated administrator with privileges to manage admin accounts (such as change_serversettings) can execute arbitrary SQL commands via a second-order SQL injection vulnerability. The flaw resides in Froxlor's administrative API endpoints, specifically during the handling of IP address mapping parameters which are stored as serialized arrays and later interpolated without sanitization into active database queries. This vulnerability allows high-privileged administrative attackers to compromise the database. By injecting a payload into administrative profile metadata, an attacker can extract sensitive credentials, manipulate backend settings, or potentially disrupt database integrity. The vulnerability affects all versions of Froxlor prior to 2.3.8.
CVE-2026-54543 is a DNS Resource Record (RR) Injection vulnerability in Froxlor, an open-source server administration control panel. Prior to version 2.3.8, the DomainZones.add API command failed to perform strict sanitization and validation on the user-controlled record (label) and type parameters before serializing them into BIND-compatible zone files. An authenticated customer with DNS zone management permissions can inject control characters, breaking out of the original record context to define unauthorized resource records within managed zones.
CVE-2026-42533 is a critical security vulnerability discovered in NGINX Open Source, NGINX Plus, NGINX Ingress Controller, and related products, referred to as the 'Two-Pass Capture-Clobbering' bug. The flaw is situated within NGINX's internal evaluation engine when handling complex variables, exposing a heap-based buffer overflow and information leak when a configuration chains regular expression-based map directives with numbered capture groups. An unauthenticated remote attacker can exploit this weakness by transmitting crafted HTTP requests to trigger remote code execution or defeat ASLR.
Froxlor prior to version 2.3.8 contains a high-severity architectural flaw where the standalone lib/ajax.php entry point bypasses the centralized request validation in lib/init.php. Unauthenticated remote attackers can leverage Cross-Site Request Forgery (CSRF) to induce authenticated administrators to submit forged requests that modify API key whitelists and expiration dates, potentially yielding persistent, out-of-band administrative control.
An insecure data retrieval flaw in the Froxlor server administration panel API allows authenticated remote attackers to retrieve unredacted bcrypt password hashes and Base32-encoded Time-Based One-Time Password (TOTP) seeds. Affected endpoints include several 'get' and 'listing' handlers for customers, administrators, and FTP accounts. Utilizing these leaked parameters, attackers can crack the password hashes offline and concurrently generate valid second-factor authentication codes to completely bypass access controls.