n8n webhook XML parser allows code execution on the server

CriticalSE Fix-First Score 51/100CVE-2026-42231SE-AIV-01819Remote code executionAI apps and chat interfacesMade public 30 Apr 2026

Download as PDF

What this means

An attacker with permission to create workflows in n8n can run code on the server where n8n runs. This gives them access to all data n8n can reach, including credentials, secrets, and connected systems. They can also modify or delete workflows and data.

SecurityElites Manager Brief: the decision in one minute

A flaw in n8n's XML handling lets users who can edit workflows run code on your server. Upgrade to version 1.123.32, 2.17.4, or 2.18.1 immediately. Until you upgrade, limit workflow creation to only trusted staff.

SecurityElites Fix-First Score51 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 7 days
Critical severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform engineering or DevOps team managing n8n.
Likely effortAbout 30 minutes per n8n instance: download and deploy the fixed version, then restart. Downtime during the restart depends on your setup. Testing the fix takes another 10 minutes.

Questions to ask your team or supplier

  • Which n8n instances do we run, and what version is each one on right now?
  • Who currently has permission to create or edit workflows, and do all of them need this access?
  • Do we have logs of all webhook requests and workflow changes for the past 30 days, and have we reviewed them for signs of this attack?

Message you can forward to the owning team

Security notice: n8n webhook XML parser allows code execution on the server (CVE-2026-42231)

Severity: Critical
SecurityElites Fix-First Score: 51 of 100
SecurityElites fix window: Within 7 days
Action: upgrade to n8n 2.18.1 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-42231-n8n-webhook-xml-parser-allows-code-execution-on-the/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01819

What is at stake in your AI setup

  • API keys and credentials for external AI services could be read and used by an attacker.
  • Prompts, chat history, and training data stored in n8n workflows could be accessed or modified.
  • Connected AI tools and systems could be controlled by an attacker to run unauthorized tasks.
  • AI model files or configuration could be accessed or the compute bill could be increased by running expensive operations.

Map where your company uses AI

Who is exposed

  • n8n instances running version 1.123.31 or earlier.
  • n8n instances running version 2.17.0 to 2.17.3.
  • n8n instances running version 2.18.0.
  • Any user with permission to create or modify workflows.

Upgrades you need

SoftwareAffected versionsMove to
n8n
npm
Every version before 1.123.32; 2.18.0 up to, but not including, 2.18.1; 2.17.0 up to, but not including, 2.17.42.18.1 or later

Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.32, 2.17.4, 2.18.1.

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Is it being attackedNo known attacks and no public attack code when CISA last reviewed it
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededNone. No login is needed
Does a person have to do somethingNo. It works without anyone clicking or opening anything
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedHigh
Risk of: the service being taken downHigh
Can attackers automate it at scaleYes, according to CISA
How much control an attacker gainsTotal control of the affected software, according to CISA

Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Kind of coding mistake

  • CWE-1321: object prototypes can be polluted

If you cannot upgrade today

  • Restrict workflow creation and editing permissions to only fully trusted users until you can upgrade.
  • Disable webhook-triggered workflows temporarily if you do not need them.
  • Monitor all workflow execution logs and audit logs closely for any unauthorized changes or execution.

Signs it may already have been used against you

  • Review webhook request logs for XML payloads with unusual structure, prototype pollution patterns (e.g., `__proto__`, `constructor`, `prototype` fields), or payloads larger than your normal workflows generate.
  • Check n8n audit logs for unexpected workflow changes, especially new or modified Git nodes or SSH operations, made by users who do not normally edit workflows.
  • Look for unexpected Git or SSH node executions in workflow execution logs, particularly those triggered by webhook requests.
  • Search for error messages related to XML parsing failures or JavaScript object prototype errors in n8n application logs.

SecurityElites Fix Guide: step by step

  1. Find where n8n is runningList all servers or containers running n8n. Note the current version of each. You can check the version in the n8n web interface under Settings or by running `npm list n8n` in the directory where n8n is installed.
  2. Check which fixed version applies to youIf you run version 1.x, upgrade to 1.123.32 or later. If you run version 2.17.x, upgrade to 2.17.4 or later. If you run version 2.18.0, upgrade to 2.18.1 or later. If you run a version higher than these, no upgrade is needed.
  3. Back up your n8n dataExport all workflows, credentials, and settings. Follow your n8n deployment guide to create a full backup of the database and configuration files. Keep the backup in a safe location.
  4. Upgrade n8n to the fixed versionStop the n8n service. Use your package manager or deployment tool to install the fixed version. For npm-based deployments, run the upgrade command supplied by your deployment automation. Start the n8n service again.
  5. Verify the upgrade was successfulCheck the n8n web interface to confirm it shows the new version number. Try loading a workflow to ensure the application is working normally. Check n8n logs for any errors.
  6. Review workflow permissionsList all users who have permission to create or edit workflows. If this includes people who should not have access, reduce their permissions. Document who has access and why.
  7. Check for signs of past exploitationReview n8n audit logs and webhook request logs for the past 30 days. Look for unusual XML payloads, unexpected workflow changes, or Git node activity. If you find suspicious activity, isolate the affected n8n instance and investigate further.
  8. Rotate credentials and secretsIf you found signs of exploitation, rotate all credentials stored in n8n, SSH keys, API tokens, and passwords for connected systems. Scan connected systems for unauthorized access or changes.

How to confirm it is fixed: Confirm that all n8n instances show version 1.123.32 or later (1.x branch), 2.17.4 or later (2.17.x branch), or 2.18.1 or later (2.18.x branch) in the Settings page or via `npm list n8n`.

SecurityElites Quick Fixes: copy and paste

Upgrade n8n with npmupgrade

npm install n8n@2.18.1
npm ls n8n

Check n8n version on npm-based installationfor this issue

npm list n8n --depth=0

Check n8n version via Dockerfor this issue

docker exec <container_name> npm list n8n --depth=0

Run the service in a locked-down containergeneral hardening

docker run --read-only --cap-drop ALL \
  --security-opt no-new-privileges --user 1000:1000 \
  -p 127.0.0.1:8080:8080 YOUR_IMAGE

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (CVE-2026-42231) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - n8n (npm): must be 2.18.1 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What is the minimum version of n8n 2.17 that is safe from this flaw?A good answer: Version 2.17.4 or later is safe; versions 2.17.0 through 2.17.3 are affected.
What must an attacker be able to do to exploit this flaw?A good answer: An attacker must have permission to create or modify workflows in n8n, then craft a malicious XML payload sent to a webhook.
If we cannot upgrade today, what temporary action should we take?A good answer: Restrict workflow creation and editing permissions to only fully trusted users, and monitor logs closely for any suspicious activity.
What systems could an attacker reach after exploiting this flaw?A good answer: An attacker could access any system n8n can reach, including all stored credentials, secrets, connected services, and data processed by workflows.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## n8n webhook XML parser allows code execution on the server (CVE-2026-42231)

**Severity:** Critical  |  **SE Fix-First Score:** 51/100  |  **Fix window:** Within 7 days
**Record:** SE-AIV-01819 https://securityelites.com/ai-vulnerabilities/cve-2026-42231-n8n-webhook-xml-parser-allows-code-execution-on-the/

### Why this matters
An attacker with permission to create workflows in n8n can run code on the server where n8n runs. This gives them access to all data n8n can reach, including credentials, secrets, and connected systems. They can also modify or delete workflows and data.

### What to do
1. Find where n8n is running
2. Check which fixed version applies to you
3. Back up your n8n data
4. Upgrade n8n to the fixed version
5. Verify the upgrade was successful
6. Review workflow permissions
7. Check for signs of past exploitation
8. Rotate credentials and secrets

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-42231-n8n-webhook-xml-parser-allows-code-execution-on-the/

### Done when
- [ ] n8n is at 2.18.1 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm that all n8n instances show version 1.123.32 or later (1.x branch), 2.17.4 or later (2.17.x branch), or 2.18.1 or later (2.18.x branch) in the Settings page or via `npm list n8n`.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 29 Apr 2026: Made public
  • 2 Dec 2026: Published

Official record

## 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

Weakness type: CWE-1321

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-42231

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 2 Dec 2026. Read the vendor advisory before changing a production system.