n8n Python Code Node sandbox can be bypassed to run commands
What this means
An authenticated user who can create or modify workflows can run any command on the server with the same access as n8n itself. This means they could read sensitive data, modify or delete files, steal credentials, or take over the entire system.
SecurityElites Manager Brief: the decision in one minute
A person with access to edit workflows in n8n can run any command on your server and steal your data or credentials. You must upgrade to version 2.0.0 or disable Python immediately.
| SecurityElites Fix-First Score | 51 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 7 days Critical severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform or DevOps team managing n8n. |
| Likely effort | About 30 minutes to 2 hours: upgrade n8n to 2.0.0 and test your workflows, or apply a workaround today if you cannot upgrade yet. Testing all workflows could take longer if you have many. |
Questions to ask your team or supplier
- Do we have any users who can edit workflows that should not be able to, or have we recently granted workflow-editing access to new people?
- What external systems and credentials are connected to n8n, and what damage could someone do if they were compromised?
- If we cannot upgrade to 2.0.0 immediately, which workaround—disabling Python, disabling Code Nodes, or enabling the task runner—fits our workflow needs best?
Message you can forward to the owning team
Security notice: n8n Python Code Node sandbox can be bypassed to run commands (CVE-2025-68668)
Severity: Critical
SecurityElites Fix-First Score: 51 of 100
SecurityElites fix window: Within 7 days
Action: upgrade to n8n 2.0.0 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-2025-68668-n8n-python-code-node-sandbox-can-be-bypassed-to/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01727What is at stake in your AI setup
- Tools and systems connected to n8n agents: an attacker could use the compromised n8n instance to call external APIs, modify databases, or trigger actions in connected services
- Credentials stored in n8n for external services: Python code execution could read and exfiltrate API keys, database passwords, and other secrets
- Training or retrieval data: if workflows process or access training data or retrieval sources, an attacker could read or delete them
Who is exposed
- n8n instances running version 1.0.0 to 1.111.0 without the task-runner Python implementation enabled
- Teams where multiple people can edit or create workflows
- Instances where Python is used in Code Nodes
- Self-hosted n8n deployments
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| n8n npm | 1.0.0 up to, but not including, 2.0.0 | 2.0.0 or later |
Am I affected?
Enter the version you run. Nothing you type is stored.
SecurityElites Developer Brief: the technical picture
| Is it being attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | An ordinary user account |
| Does a person have to do something | No. It works without anyone clicking or opening anything |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | Limited |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Total control of the affected software, according to CISA |
Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L
Kind of coding mistake
- CWE-693
If you cannot upgrade today
- Set environment variable N8N_PYTHON_ENABLED=false to disable Python in Code Nodes (available since n8n 1.104.0); this stops the vulnerability but blocks Python workflows until you upgrade
- Set NODES_EXCLUDE to block all Code Nodes; this is more severe but safest: export NODES_EXCLUDE='["n8n-nodes-base.code"]'
- If on version 1.111.0 or later, enable the safer task-runner sandbox by setting N8N_RUNNERS_ENABLED=true and N8N_NATIVE_PYTHON_RUNNER=true; then upgrade to 2.0.0 when ready
Signs it may already have been used against you
- Check workflow audit logs for Code Nodes created or modified by users who should not need them, especially between when you deployed your current version and now
- Look for Python Code Nodes that import unusual modules like `os`, `subprocess`, or `socket` that reach outside the workflow
- Search execution logs for Code Node runs that failed with permission or sandbox errors
- Review credential audit logs for access or export of sensitive values during or after the vulnerable period
Log searches to start from
Code Node executions in audit logs (field names must be adapted to your logging)Splunk
source=n8n_audit node_type=code | stats count by user, timestamp, node_namePython Code Node activity (field names must be adapted to your logging)Elastic
node_type:code AND language:python | aggregations by user.name, timestampWritten with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.
SecurityElites Fix Guide: step by step
- Find where n8n is running and what version it isLog into your n8n instance. Go to Settings or About and note the version number. Check whether you are using n8n Cloud or a self-hosted deployment. If self-hosted, note where it runs (Docker, Kubernetes, bare server).
- Check if you are on version 2.0.0 or laterIf your version is 2.0.0 or later, the safer Python sandbox is on by default and you are protected. If your version is 1.111.0 or later but below 2.0.0, check whether N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER environment variables are set to enable the safer sandbox.
- If below version 1.111.0 or task runner is not enabled, apply a workaround todayChoose one: (1) set environment variable NODES_EXCLUDE to block all Code Nodes, (2) set N8N_PYTHON_ENABLED=false to disable Python only, or (3) set N8N_RUNNERS_ENABLED=true and N8N_NATIVE_PYTHON_RUNNER=true to enable the safer sandbox. Restart n8n for the change to take effect.
- Back up your workflows and credentialsExport or snapshot your n8n configuration so you can restore if anything goes wrong during the upgrade.
- Upgrade n8n to version 2.0.0 or laterFollow your deployment method: for Docker, pull the new image; for npm, run npm update; for other methods, follow the n8n upgrade guide for your setup. The safer Python sandbox is the default in 2.0.0.
- Restart n8n and verify the new version is runningAfter the upgrade, restart the n8n service or container. Log back in and confirm the version shown in Settings is 2.0.0 or later.
- Test your Python workflowsRun a few workflows that use Python Code Nodes to make sure they still work. Watch for any errors or unexpected behavior.
- Review workflow permissions and audit recent changesCheck who has permission to create and edit workflows. Review the audit log or workflow history to see if anyone created unusual Python Code Nodes while your version was vulnerable. If you see suspicious activity, investigate and secure any exposed credentials.
How to confirm it is fixed: Check the installed n8n version using the Settings page or npm list command; version 2.0.0 or later confirms the fix is in place. For versions 1.111.0 to 1.999.x, verify that environment variables N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER are both set t
SecurityElites Quick Fixes: copy and paste
Upgrade n8n with npmupgrade
npm install n8n@2.0.0
npm ls n8nCheck n8n version via Dockerfor this issue
docker exec <container-name> npm list n8nDisable Python Code Node (temporary workaround)for this issue
export N8N_PYTHON_ENABLED=falseEnable task-runner Python sandbox (n8n 1.111.0+)for this issue
export N8N_RUNNERS_ENABLED=true
export N8N_NATIVE_PYTHON_RUNNER=trueRun 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_IMAGETest 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-2025-68668) 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.0.0 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.
Ticket for your backlog
Paste into Jira, GitHub Issues or any tracker that reads Markdown.
Ready-made ticket
## n8n Python Code Node sandbox can be bypassed to run commands (CVE-2025-68668)
**Severity:** Critical | **SE Fix-First Score:** 51/100 | **Fix window:** Within 7 days
**Record:** SE-AIV-01727 https://securityelites.com/ai-vulnerabilities/cve-2025-68668-n8n-python-code-node-sandbox-can-be-bypassed-to/
### Why this matters
An authenticated user who can create or modify workflows can run any command on the server with the same access as n8n itself. This means they could read sensitive data, modify or delete files, steal credentials, or take over the entire system.
### What to do
1. Find where n8n is running and what version it is
2. Check if you are on version 2.0.0 or later
3. If below version 1.111.0 or task runner is not enabled, apply a workaround today
4. Back up your workflows and credentials
5. Upgrade n8n to version 2.0.0 or later
6. Restart n8n and verify the new version is running
7. Test your Python workflows
8. Review workflow permissions and audit recent changes
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2025-68668-n8n-python-code-node-sandbox-can-be-bypassed-to/
### Done when
- [ ] n8n is at 2.0.0 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Check the installed n8n version using the Settings page or npm list command; version 2.0.0 or later confirms the fix is in place. For versions 1.111.0 to 1.999.x, verify that environment variables N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER are both set t
- [ ] 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.
Related vulnerabilities
In the same software
- n8n legacy expression engine allows code execution via JSON.stringify override High · CVE-2026-86083
- n8n OpenAI node bypasses domain restrictions on model search High · CVE-2026-86082
- n8n Git node can freeze the instance with a crafted path High · CVE-2026-86081
- n8n OAuth registration accepts unlimited field sizes, filling the database High · CVE-2026-86075
- n8n expression compiler can run arbitrary code through class field names High · CVE-2026-86076
- n8n Edit Fields node can crash the whole instance with a bad field name High · CVE-2026-72749
The same kind of mistake in other AI tools
- Langflow OSS allows arbitrary code execution through tool listing without admin check High · CVE-2026-128876
- Langflow OSS can run arbitrary code via tool-call interface before admin check High · CVE-2026-128867
- Langflow OSS allows remote code execution through improper code handling High · CVE-2026-127065
- Langflow OSS allows authenticated users to run arbitrary code High · CVE-2026-122088
- Langflow OSS allows authenticated users to run any command on the server High · CVE-2026-120601
Change history
- 26 Dec 2025: Made public
- 2 Dec 2026: Published
Official record
### 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)](https://docs.n8n.io/hosting/securing/blocking-nodes/) - 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_ENABLED` and `N8N_NATIVE_PYTHON_RUNNER` environment variables. ([Docs](https://docs.n8n.io/hosting/configuration/task-runners/))### Resources - n8n documentation: [Blocking access to nodes](https://docs.n8n.io/hosting/securing/blocking-nodes/) - n8n documentation: [Code Node (Python)](https://docs.n8n.io/code/code-node/#python-native) - n8n documentation: [Task Runners](https://docs.n8n.io/hosting/configuration/task-runners/)
Weakness type: CWE-693
Use this record in your own tools
Get this record as JSON
curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2025-68668For 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.