n8n Python Code Node can run any code on the task runner
What this means
An authorized user who can create or change workflows could run any code on the server that runs Python tasks. An attacker with this access could read data, change files, run commands, or use the server to attack other systems.
SecurityElites Manager Brief: the decision in one minute
n8n's Python Code Node lets authorized users break out of the sandbox and run any code on the server. Upgrade to versions 1.123.48, 2.21.8, or 2.22.4 immediately. Until then, disable the Python Code Node and restrict who can edit workflows.
| SecurityElites Fix-First Score | 43 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 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform engineering or DevOps team managing n8n infrastructure. |
| Likely effort | About 30 minutes to 1 hour per n8n instance: download the fixed version, upgrade, and restart. Longer if you have many integrations or if the Python Task Runner was heavily used and needs to stay disabled during upgrade planning. |
Questions to ask your team or supplier
- Do you have the Python Task Runner enabled, and if so, which users are allowed to create or edit workflows that use it?
- Have you reviewed audit logs to see whether Python Code Nodes have been used by any users other than expected, particularly in the past three months?
- What is your process for verifying that all n8n instances across development, staging, and production are on the same supported version after an upgrade?
Message you can forward to the owning team
Security notice: n8n Python Code Node can run any code on the task runner (CVE-2026-49444)
Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.22.4 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-49444-n8n-python-code-node-can-run-any-code-on/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01752What is at stake in your AI setup
- Prompts and chat history: an attacker could read or modify prompts stored in n8n workflows, changing how AI agents behave.
- AI provider keys: an attacker could extract API keys for OpenAI, Anthropic, or other providers and use them for their own purposes.
- Tools and integrations connected to AI agents: an attacker could modify or redirect data flowing through connected systems, changing business logic or stealing data.
- Training and retrieval data: if workflows connect to data stores used for training or retrieval-augmented generation, an attacker could read, modify, or poison that data.
Who is exposed
- n8n instances with Python Task Runner enabled and multiple authorized workflow editors.
- Teams where non-admin staff can create or modify workflows.
- Shared n8n deployments across multiple projects or departments.
- Development and staging environments running production data.
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| n8n npm | Every version before 1.123.48; 2.22.0 up to, but not including, 2.22.4; 2.0.0-rc.0 up to, but not including, 2.21.8 | 2.22.4 or later |
Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.48, 2.21.8, 2.22.4.
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 | Limited |
| Risk of: the service being taken down | None |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Partial control, 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:L/A:N
Kind of coding mistake
- CWE-20: input is not checked properly
If you cannot upgrade today
- Disable the Python Code node by adding `n8n-nodes-base.code` to the `NODES_EXCLUDE` environment variable until you can upgrade.
- Disable the Python Task Runner entirely via configuration or environment variables.
- Restrict workflow creation and editing permissions to a small group of fully trusted users only.
Signs it may already have been used against you
- Review n8n audit logs for Python Code Node executions by non-admin users, especially any that ran unexpected or suspicious code.
- Check task runner container logs for unusual process spawning, file access outside workflow directories, or execution of commands not part of normal workflow activity.
- Look for unexpected outbound network connections from the task runner, reverse shells, or tools being downloaded or executed.
- Monitor the task runner's system logs for privilege escalation attempts or access to sensitive files like credentials or configuration.
Log searches to start from
Python Code Node executions in n8n audit log (field names must be adapted to your logs)Splunk
source="*n8n*audit*" node_type="python" OR node_type="codeNode" | stats count by user, node_type, timestampUnusual process spawning in task runner container (field names must be adapted)Elastic
process.parent.name:"python*" AND container.name:"*n8n*task*" AND process.name:(bash OR sh OR curl OR wget OR nc)Written 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 all n8n instances in your environmentList every server or container running n8n, including production, staging, and development. Note the current version of each by checking the UI, logs, or running the n8n CLI command to list the version.
- Check which instances have Python Task Runner enabledFor each n8n instance, check the environment variables and configuration to see if the Python Task Runner is active. Look for `PYTHON_TASK_RUNNER_ENABLED` or similar settings in startup logs or configuration files.
- Review workflow editor permissionsList all users and teams that have permission to create or edit workflows on each affected instance. Identify any non-admin or external users who should not have this access.
- Upgrade n8n to the fixed versionFor version 1.x: upgrade to 1.123.48 or later. For version 2.0–2.21: upgrade to 2.21.8 or later. For version 2.22.0–2.22.3: upgrade to 2.22.4 or later. Use your package manager (npm, container image, or Docker) to pull the fixed version and deploy it.
- Restart the n8n serviceAfter upgrading the code, restart the n8n process and all Python Task Runner instances. Wait for them to become healthy and confirm they are running the new version.
- Verify the fix is in placeCheck the n8n UI or CLI to confirm the new version is running. If you encounter issues, check logs for startup errors or configuration problems.
- Review and enforce workflow permissionsAudit and revoke workflow creation and editing permissions from users who do not need them. Ensure only trusted staff and automation accounts have access to create or modify workflows.
- Check for signs of prior exploitationReview audit logs and task runner logs for the period before the upgrade. Look for unexpected Python code execution, unusual process spawning, or access to files outside the normal workflow paths.
How to confirm it is fixed: Check that every n8n instance reports version 1.123.48, 2.21.8, 2.22.4 or later in the UI or via the `n8n --version` command.
SecurityElites Quick Fixes: copy and paste
Upgrade n8n with npmupgrade
npm install n8n@2.22.4
npm ls n8nCheck n8n version (n8n CLI)for this issue
n8n --versionCheck if Python Task Runner is enabled (from environment)for this issue
echo $PYTHON_TASK_RUNNER_ENABLEDDisable Python Code node as temporary workaround (environment variable)for this issue
export NODES_EXCLUDE='n8n-nodes-base.code'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_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-2026-49444) 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.22.4 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 can run any code on the task runner (CVE-2026-49444)
**Severity:** High | **SE Fix-First Score:** 43/100 | **Fix window:** Within 30 days
**Record:** SE-AIV-01752 https://securityelites.com/ai-vulnerabilities/cve-2026-49444-n8n-python-code-node-can-run-any-code-on/
### Why this matters
An authorized user who can create or change workflows could run any code on the server that runs Python tasks. An attacker with this access could read data, change files, run commands, or use the server to attack other systems.
### What to do
1. Find all n8n instances in your environment
2. Check which instances have Python Task Runner enabled
3. Review workflow editor permissions
4. Upgrade n8n to the fixed version
5. Restart the n8n service
6. Verify the fix is in place
7. Review and enforce workflow permissions
8. Check for signs of prior exploitation
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-49444-n8n-python-code-node-can-run-any-code-on/
### Done when
- [ ] n8n is at 2.22.4 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Check that every n8n instance reports version 1.123.48, 2.21.8, 2.22.4 or later in the UI or via the `n8n --version` command.
- [ ] 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
- 16 Jun 2026: Made public
- 2 Dec 2026: Published
Official record
## 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.48, 2.21.8, and 2.22.4. 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.code` to the `NODES_EXCLUDE` environment 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.
Weakness type: CWE-20
Use this record in your own tools
Get this record as JSON
curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-49444For 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 3 Dec 2026. Read the vendor advisory before changing a production system.