CVE-2026-45707: n8n-MCP: Multi-tenant MCP requests fall back to process-level n8n credentials when tenant headers are absent or incomplete
In n8n-mcp 2.51.1 and earlier, running with ENABLE_MULTI_TENANT=true, a request that leaves out the x-n8n-url and x-n8n-key headers, or sends only one, silently falls back to the operator's own N8N_API_URL and N8N_API_KEY. An authenticated tenant then manages the operator's n8n instance. Upgrade to n8n-mcp 2.51.2.
Published May 18, 2026 · Updated Jun 9, 2026 · Analysis Oct 27, 2026
What an attacker can do
Multi-tenant mode in the HTTP transport is meant to pick the target n8n instance for each request from the x-n8n-url and x-n8n-key headers. When either header was missing, the server instead built its n8n API client from the process-level N8N_API_URL and N8N_API_KEY set for the operator's own instance. A tenant who simply omitted the headers had their n8n management calls executed against the operator's n8n with the operator's key.
The tenant needs valid access to the n8n-mcp service but nothing else. Through the MCP tools they could read and write workflows, executions, data-table contents and credential metadata on the operator's instance. The operator's key is usually powerful: Community Edition keys are unscoped, and Enterprise scopes were set for the operator's own use. If the operator's n8n allows Code-node execution that reaches OS-level modules, the advisory says this could grow into remote code execution in the operator's n8n runtime.
Several tool responses also leaked the operator's URL and an indicator of the environment key. Single-tenant deployments, where ENABLE_MULTI_TENANT is unset or false, are not affected. The risk falls on hosted, shared n8n-mcp services.
Who is affected
npm package n8n-mcp at 2.51.1 or earlier, only for HTTP-mode deployments run with ENABLE_MULTI_TENANT=true. Check the version and the setting:
npm ls -g n8n-mcp
env | grep ENABLE_MULTI_TENANTFor Docker, check the image tag of ghcr.io/czlonkowski/n8n-mcp and the container's environment. Also check whether N8N_API_URL and N8N_API_KEY are set in the same process, since that is what the fallback uses.
n8n-mcp
- Ecosystem
- npm
- Affected
- <= 2.51.1
- Fixed in
- 2.51.2
- Check
npm ls n8n-mcp
How to fix it
Upgrade to n8n-mcp 2.51.2 (npx n8n-mcp@latest, or docker pull ghcr.io/czlonkowski/n8n-mcp:latest). The fix rejects multi-tenant requests without the headers at the HTTP edge with HTTP 400 and JSON-RPC error -32602, refuses to build an env-credential n8n client when ENABLE_MULTI_TENANT=true, and removes leaks of the operator's URL and key indicator from n8n_health_check, n8n_diagnostic, n8n_deploy_template and n8n_audit_instance.
Workarounds from the advisory: turn multi-tenant mode off and run one n8n-mcp instance per tenant with its own credentials; have a proxy return 400 unless both headers are present (partial only); and scope the operator's N8N_API_KEY to the minimum permissions. Rotate the operator key if tenants were not fully trusted.
How to tell if you were hit
Check n8n-mcp access logs for HTTP requests that reached tool handlers without both x-n8n-url and x-n8n-key. On the operator's n8n instance, review the audit trail and API access for workflow edits, executions and credential reads that line up with tenant sessions, and for new workflows or Code nodes you did not create. Check execution history for odd activity from OS-level modules.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
When ENABLE_MULTI_TENANT=true, the HTTP transport documents that the target n8n instance is selected per-request from x-n8n-url / x-n8n-key headers. Requests that omitted those headers — or supplied only one of them — silently fell back to the process-level N8N_API_URL / N8N_API_KEY credentials configured for the operator's own n8n instance. As a result, an authenticated MCP tenant could cause n8n management calls to execute against the operator's instance instead of its own.
This affects HTTP-mode deployments of n8n-mcp that are run as a shared multi-tenant service. Single-tenant deployments (ENABLE_MULTI_TENANT unset or false) are not affected.
Impact
An authenticated MCP tenant exploiting this path could read and write workflows, executions, data-table contents, and credential metadata on the operator's n8n instance. If the operator's n8n permits Code-node execution that reaches OS-level modules, the path could escalate to remote code execution inside the operator's n8n runtime. The process-level N8N_API_KEY is, in practice, a high-privilege key — Community Edition keys are unscoped by default, and even Enterprise scopes were configured for the operator's own needs and would carry over wholesale to a tenant who triggered the fallback.
Patches
Fixed in n8n-mcp 2.51.2. The fix:
- Rejects header-less multi-tenant requests at the HTTP edge with HTTP 400 / JSON-RPC
-32602before any handler runs. - Refuses to construct an env-credential n8n API client when
ENABLE_MULTI_TENANT=true. - Closes secondary leak paths in trigger handlers and in the responses of
n8n_health_check,n8n_diagnostic,n8n_deploy_template, andn8n_audit_instanceso the operator's URL and env-key indicator are not surfaced to tenants.
Single-tenant behavior is unchanged.
Upgrade
# NPM
npx n8n-mcp@latest
# Docker
docker pull ghcr.io/czlonkowski/n8n-mcp:latestWorkarounds
If an immediate upgrade is not possible, any one of the following reduces or eliminates exposure:
- Disable multi-tenant mode. Set
ENABLE_MULTI_TENANT=false(or unset it) and run a separate n8n-mcp instance per tenant with that tenant's ownN8N_API_URL/N8N_API_KEY. This removes the affected code path entirely. - Reject malformed requests at a proxy. Require both
x-n8n-urlandx-n8n-keyheaders on every request and return 400 if either is missing. Neutralizes the primary header-omission path but does not address the secondary response-shape disclosures, so this is a partial mitigation only. - Reduce the blast radius of the operator API key. If your n8n instance supports API key scoping (Enterprise, or a Community Edition build that exposes scopes), provision the operator's
N8N_API_KEYwith the minimum scopes required for the operator's own n8n-mcp functions. This does not close the boundary break but limits what a falling-back tenant can do.
Credit
Reported by @u-ktdi.
Credited to u-ktdi.
Questions
- Are single-tenant n8n-mcp deployments affected?
No. The advisory says deployments with ENABLE_MULTI_TENANT unset or false are not affected.
- What can a tenant do with the fallback?
Read and write workflows, executions, data-table contents and credential metadata on the operator's n8n instance, and potentially reach code execution if Code nodes can use OS-level modules.
- Which version fixes CVE-2026-45707?
n8n-mcp 2.51.2. It rejects requests that lack the tenant headers and never builds an env-credential client in multi-tenant mode.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Other MCP servers and tools vulnerabilities
All Other MCP servers and tools entriesCVE-2026-102943
Dagu MCP DAG specification read bypasses path containment and workspace isolation
medium6.5Nov 10, 2026CVE-2026-102610
fast-agent: `fast-agent serve` binds HTTP to 0.0.0.0 with no authentication by default; with --shell this is unauthenticated remote command execution
medium6.4Nov 9, 2026CVE-2026-63655
tsParticles: Unbounded HTTP Request Body Buffering in @tsparticles/mcp-server Leads to Remote DoS
high7.5Nov 9, 2026CVE-2026-76892
tsParticles: Malformed JSON requests can terminate the @tsparticles/mcp-server HTTP process
high8.7Nov 9, 2026CVE-2026-76893
tsParticles: A single anonymous MCP session can monopolize HTTP mode and deny new clients
medium6.9Nov 9, 2026CVE-2026-77604
Code Graph RAG: MCP paginated read_file path traversal / arbitrary file read
high7.5Nov 9, 2026
