CVE-2025-68668: n8n Vulnerable to Arbitrary Command Execution in Pyodide based Python Code Node
n8n 1.x runs Python in the Code node inside a Pyodide sandbox, and that sandbox can be bypassed. A signed-in user who can create or edit workflows can run arbitrary commands on the n8n host with the n8n process's privileges. n8n 2.0.0 fixes it by making a task-runner-based native Python sandbox the default.
Published Dec 26, 2025 · Updated Jan 5, 2026 · Analysis Nov 1, 2026
What an attacker can do
The Python Code node on n8n 1.x executes user-written Python through Pyodide inside the n8n process. The advisory classes the flaw as a protection mechanism failure (CWE-693): code in the node can escape the sandbox and reach the host. The commands then run as the same user as n8n.
The attacker needs an account that can create or modify workflows. No other interaction is needed, and the scope changes, which is why the score is 9.9. On a shared n8n instance, any editor can become the server's operating-system user. From there they can read the n8n environment, stored credentials for connected services, API keys and the database, and they can pivot into the network n8n sits on.
This matters for AI work because n8n is widely used to wire agents, LLM calls and tool integrations together. Those workflows hold many high-value secrets. A workflow imported from an untrusted source or built by a compromised account can carry the exploit.
Who is affected
npm package n8n >= 1.0.0, < 2.0.0. Exposure requires the Code node with Python and a user allowed to edit workflows. Native Python via task runners was optional from 1.111.0 and is only the default from 2.0.0.
Check the version:
npm ls n8nFor Docker, run n8n --version inside the container. Also check whether N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER are set.
n8n
- Ecosystem
- npm
- Affected
- >= 1.0.0, < 2.0.0
- Fixed in
- 2.0.0
- Check
npm ls n8n
How to fix it
Upgrade to n8n 2.0.0, where the task-runner-based native Python implementation is the default:
npm install -g [email protected]Workarounds from the advisory if you cannot upgrade yet:
- Disable the Code node with
NODES_EXCLUDE="[\"n8n-nodes-base.code\"]". - Disable Python in the Code node with
N8N_PYTHON_ENABLED=false(available since 1.104.0). - Turn on the task-runner Python sandbox with
N8N_RUNNERS_ENABLEDandN8N_NATIVE_PYTHON_RUNNER(available since 1.111.0).
How to tell if you were hit
The advisory gives no log signatures. Review workflows for Code nodes set to Python, especially ones created or changed by users who should not need them, and check the execution history of those workflows. On the host, look for child processes of the n8n process that you do not expect, outbound connections from n8n to unfamiliar hosts, and new files in n8n's data directory. Rotate credentials stored in n8n if you find signs of misuse.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
A sandbox bypass vulnerability exists in the Python Code Node that uses Pyodide.
An authenticated user with permission to create or modify workflows can exploit this vulnerability to execute arbitrary commands on the host system running n8n, using the same privileges as the n8n process.
Patches
In n8n version 1.111.0, a task-runner-based native Python implementation was introduced as an optional feature, providing a more secure isolation model.
To enable it, you need to configure the N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER environment variables.
This implementation became the default starting with n8n version 2.0.0.
Workarounds
- Disable the Code Node by setting the environment variable
NODES_EXCLUDE: "[\"n8n-nodes-base.code\"]"(Docs) - Disable Python support in the Code node by setting the environment variable
N8N_PYTHON_ENABLED=false, which was introduced in n8n version 1.104.0. - Configure n8n to use the task runner based Python sandbox via the
N8N_RUNNERS_ENABLEDandN8N_NATIVE_PYTHON_RUNNERenvironment variables. (Docs)
Resources
- n8n documentation: Blocking access to nodes
- n8n documentation: Code Node (Python)
- n8n documentation: Task Runners
Credited to berkdedekarginoglu, VladimirEliTokarev, Ofekitach, nnfrog.
Questions
- Does CVE-2025-68668 need authentication?
Yes. The attacker needs a user account with permission to create or modify workflows. Instances with many editors or shared accounts carry more risk.
- Is n8n 1.111.0 safe?
Only if you enabled the native Python runner with N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER. In 1.x it is opt-in. It is the default from 2.0.0.
- Can I avoid upgrading?
The advisory lists workarounds: exclude the Code node, set N8N_PYTHON_ENABLED=false, or enable the task-runner Python sandbox. Upgrading to 2.0.0 is the full fix.
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
