CVE-2026-42234: n8n has a Python Task Runner Sandbox Escape Vulnerability
An n8n user who can create or edit workflows with a Python Code node can escape the sandbox and run arbitrary code on the task runner container. It only affects instances that have the Python Task Runner enabled. 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
The Python Code node runs user code in a sandbox on the Python Task Runner. A flaw lets that code break out (CWE-94) and execute arbitrary commands in the runner's container. The advisory does not describe the escape technique.
The attacker is a logged-in user with permission to create or modify workflows. They add a Python Code node, run the workflow and get a shell in the task runner container. From there they can read what the runner holds: the data of the workflows it executes, and any secrets or tokens in the container's environment. The CVSS 4.0 vector rates confidentiality impact high and integrity low, and does not extend to the n8n main process. How much that gives depends on how the runner is deployed and what network access its container has.
Instances without the Python Task Runner are not affected. Editors on a shared instance are the ones to worry about: anyone with editor rights becomes able to run code in the runner container.
Who is affected
The npm package n8n below 1.123.32, 2.17.x below 2.17.4, and 2.18.0, only where the Python Task Runner is enabled and a user can create Python Code nodes.
npm ls n8nFor Docker setups, check the image tags of both n8n and the task runner container.
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 mitigations from the advisory (not a full remediation): limit workflow creation and editing to fully trusted users, and disable the Python Code node by adding n8n-nodes-base.code to the NODES_EXCLUDE environment variable, or turn off the Python Task Runner. Note that excluding that node name also disables the JavaScript Code node.
How to tell if you were hit
Review workflows with Python Code nodes and who edited them. On the task runner container, look for unexpected processes, outbound network connections and file changes outside the runner's work directory. Check the runner's logs for tracebacks that mention imports or interpreter internals.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
An authenticated user with permission to create or modify workflows containing a Python Code Node could escape the sandbox and achieve arbitrary code execution on the task runner container.
- This issue only affects instances where the Python Task Runner is enabled.
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.
- Disable the Python Code node by adding
n8n-nodes-base.codeto theNODES_EXCLUDEenvironment variable, or disable the Python Task Runner entirely.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Credited to dorjoos.
Questions
- Does it affect instances without Python Task Runner?
No. The advisory says it only affects instances where the Python Task Runner is enabled.
- Does the attacker need to log in?
Yes. They need permission to create or modify workflows that contain a Python Code node.
- Which versions fix CVE-2026-42234?
n8n 1.123.32, 2.17.4 and 2.18.1 or later.
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
