CVE-2026-42231: n8n has Prototype Pollution in XML Webhook Body Parser that Leads to RCE
n8n's webhook handler parses XML bodies with the xml2js library, which allowed prototype pollution from a crafted XML payload. Chained with the Git node's SSH operations, that gives remote code execution on the n8n host. Fixed in n8n 1.123.32, 2.17.4 and 2.18.1.
Published Apr 29, 2026 · Updated May 8, 2026 · Analysis Oct 28, 2026
What an attacker can do
A crafted XML request body reaches xml2js in n8n's webhook handler and pollutes the JavaScript object prototype (CWE-1321). Prototype pollution on its own changes default properties of every object in the process. The advisory chains it with the Git node's SSH operations: the polluted properties influence how the node builds its SSH command, and the result is code execution on the host.
The advisory text says an authenticated user who can create or modify workflows can exploit it. The CVSS vectors list no privileges and no user interaction, with a score of 10, which fits a webhook that anyone can post to. A workflow with a webhook that accepts XML and a Git node together provides the path.
Code execution as the n8n process gives access to every stored credential, the database, environment variables and the network the host sits on. n8n instances commonly hold keys for many SaaS tools and AI providers, so the blast radius is wide.
Who is affected
The npm package n8n below 1.123.32, 2.17.x below 2.17.4, and 2.18.0 (below 2.18.1). Instances that use webhooks and the Git node are the ones that fit the described chain.
npm ls n8nFor Docker, check the image tag. The version is also in the n8n UI under Settings, About.
n8n
- Ecosystem
- npm
- Affected
- < 1.123.32
- Fixed in
- 1.123.32
- Check
npm ls n8n
n8n
- Ecosystem
- npm
- Affected
- >= 2.18.0, < 2.18.1
- Fixed in
- 2.18.1
- Check
npm ls n8n
n8n
- Ecosystem
- npm
- Affected
- >= 2.17.0, < 2.17.4
- Fixed in
- 2.17.4
- Check
npm ls n8n
How to fix it
Upgrade to n8n 1.123.32, 2.17.4 or 2.18.1, or later. Temporary mitigation from the advisory, which does not fully remediate it: limit workflow creation and editing to fully trusted users.
npm install -g [email protected]How to tell if you were hit
Review active workflows that have Webhook triggers accepting XML together with Git nodes. In execution logs, look for webhook requests with an XML content type and keys such as __proto__, constructor or prototype. On the host, check the n8n process for unexpected child processes, especially ssh or git invocations with unusual arguments. Beam does not see inside n8n, but records shell commands that agents run on the host.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
A flaw in the xml2js library used to parse XML request bodies in n8n's webhook handler allowed prototype pollution via a crafted XML payload. An authenticated user with permission to create or modify workflows could exploit this to pollute the JavaScript object prototype and, by chaining the pollution with the Git node's SSH operations, achieve remote code execution on the n8n host.
Patches
The issue has been fixed in n8n versions 1.123.32, 2.17.4, and 2.18.1. Users should upgrade to one of these versions or later to remediate the vulnerability.
Workarounds
If upgrading is not immediately possible, administrators should consider the following temporary mitigations:
- Limit workflow creation and editing permissions to fully trusted users only.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
--- n8n has adopted CVSS 4.0 as primary score for all security advisories. CVSS 3.1 vector strings are provided for backwards compatibility.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Credited to a-tallat.
Questions
- Is CVE-2026-42231 exploitable without an account?
The advisory text says an authenticated user with workflow permissions. The CVSS vectors rate it with no privileges required. Treat any public XML webhook as exposed.
- Which node completes the chain?
The Git node's SSH operations, per the advisory. The pollution is chained with them to reach code execution on the host.
- Which versions fix it?
n8n 1.123.32, 2.17.4 and 2.18.1 or later, depending on your release line.
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 n8n vulnerabilities
All n8n entriesCVE-2026-86073
n8n: Per-Resource OAuth Consent Bypass via Unbound Refresh Token Resource Substitution
medium5.9Sep 10, 2026CVE-2026-86074
n8n: Instance AI Credential Setup Accepts Unvalidated Probe URL from Fetched Content
medium5.9Sep 10, 2026CVE-2026-86075
n8n: Unauthenticated Persistent Storage Exhaustion via OAuth Dynamic Client Registration Endpoint
high8.7Sep 10, 2026CVE-2026-86076
n8n: Expression Sandbox Escape via Class-Field Sanitizer Rebinding Can Lead to Code Execution
high8.7Sep 10, 2026CVE-2026-86077
n8n: Anonymous Approval-Gate Bypass via Reused resumeToken over the Chat WebSocket
medium6.3Sep 10, 2026CVE-2026-86078
n8n: Prototype Pollution via Workflow Structure Summary Can Lead to Denial of Service
medium6.0Sep 10, 2026
