n8n Python Code Node can run arbitrary code on the task runner

HighSE Fix-First Score 43/100CVE-2026-42234SE-AIV-01716Remote code executionAI apps and chat interfacesMade public 30 Apr 2026

Download as PDF

What this means

An authenticated user who can create or change workflows could run any code on the server that runs Python tasks. This could lead to data theft, installation of malware, disruption of service, or use of the server to attack other systems. The risk applies only to instances where the Python Task Runner is turned on.

SecurityElites Manager Brief: the decision in one minute

A person who can edit workflows in n8n can run code on the server that runs Python tasks. You need to upgrade to version 1.123.32, 2.17.4, or 2.18.1 immediately. If you cannot upgrade right away, disable Python Code Node or the Python Task Runner.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixInfrastructure and operations team
Likely effortAbout 15 minutes per n8n instance: check the version, upgrade to the fixed version, and restart. Upgrade time depends on your deployment method (Docker, npm, or hosted). If you need to temporarily disable Python instead, changing an environment variable and re

Questions to ask your team or supplier

  • Do we have the Python Task Runner enabled in any of our n8n instances, and if so, in which ones and on which versions?
  • Who has permission to create or edit workflows in our n8n instances, and are all of them fully trusted?
  • What is our deployment method for n8n, and do we have a tested upgrade and rollback procedure in place?

Message you can forward to the owning team

Security notice: n8n Python Code Node can run arbitrary code on the task runner (CVE-2026-42234)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 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-42234-n8n-python-code-node-can-run-arbitrary-code-on/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01716

What is at stake in your AI setup

  • API keys and credentials stored in n8n workflows could be extracted and used against external AI services or data sources.
  • Prompts and instructions embedded in Python Code Nodes could be read or modified to change the behavior of AI-connected workflows.
  • Training data, fine-tuning datasets, or retrieval-augmented generation (RAG) data accessed by workflows could be exfiltrated or corrupted.
  • The compute bill for AI services could spike if an attacker uses workflow connections to call expensive AI models or services at scale.

Map where your company uses AI

Who is exposed

  • n8n instances with Python Task Runner enabled and version before 1.123.32, or 2.17.0–2.17.3, or 2.18.0
  • Teams where users with workflow creation or editing rights are not fully trusted
  • Shared n8n instances used by multiple teams or business units

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 readNone
Risk of: data or settings being changedNone
Risk of: the service being taken downHigh
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
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:U/C:N/I:N/A:H

Kind of coding mistake

  • CWE-94: code can be injected

If you cannot upgrade today

  • Limit workflow creation and editing permissions to only fully trusted team members. Remove access for contractors, temporary staff, or low-privilege users.
  • Disable the Python Code node by adding `n8n-nodes-base.code` to the `NODES_EXCLUDE` environment variable, or disable the Python Task Runner entirely by setting the appropriate configuration flag.
  • These steps reduce risk but do not eliminate it. Upgrade as soon as possible.

Signs it may already have been used against you

  • Check audit logs or workflow history for recent changes to Python Code Node workflows by users with low privilege levels or external users.
  • Look for Python Code Node workflows created or modified in the time window between when this vulnerability was introduced in your version and when you upgraded.
  • Monitor task runner container logs for unusual Python code execution, errors, or processes spawned from the Python sandbox that do not match your known workflows.
  • If you have access to container or host logs, search for privilege escalation attempts or unexpected system commands run during Python task execution.

Log searches to start from

Recent Python Code Node workflow modifications (adapt field names for your logs)Splunk

source="n8n_audit_log" OR source="n8n_workflow_log" node_type="code" language="python" (action="create" OR action="modify") | stats count by user, timestamp, workflow_name

Python task runner errors and unexpected processes (adapt field names for your logs)Elastic

component:"python_task_runner" (error OR exception OR process_spawn) | fields @timestamp, component, message, process_name

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

  1. Find your n8n versionLog in to your n8n instance and go to Settings > About. Write down the version number. You can also check by running `npm list n8n` if you installed it with npm.
  2. Check if Python Task Runner is enabledIf you do not know, ask the team member who set up n8n or check the deployment configuration. Look for PYTHONWORKER or Python Task Runner settings. If it is not mentioned in your setup, it is probably not enabled.
  3. If Python is enabled and your version is affected, plan the upgradeIf your version is before 1.123.32, or 2.17.0 through 2.17.3, or 2.18.0, you must upgrade. Choose the fixed version that matches your current release line: upgrade to 1.123.32 (if on 1.x), 2.17.4 (if on 2.17.x), or 2.18.1 (if on 2.18.x).
  4. Back up your n8n instanceBefore upgrading, back up your database and any workflow files. The backup method depends on your deployment: for Docker, use `docker exec` to dump your database; for npm, back up your .n8n folder. Ask your infrastructure team if you are unsure.
  5. Upgrade n8n to the fixed versionFollow your deployment method: for npm, run `npm install n8n@1.123.32` (or the appropriate fixed version); for Docker, update the image tag and restart the container; for hosted n8n, the upgrade may happen automatically. Confirm the new version is running before proceeding.
  6. Verify the upgrade was successfulLog in to n8n and check Settings > About to confirm the version matches the fixed version you installed (1.123.32, 2.17.4, or 2.18.1 or later).
  7. Review workflow permissionsEven after upgrading, review who has permission to create or edit workflows. Remove workflow creation rights from users who do not need them, especially if they are not fully trusted.
  8. If you chose to disable Python instead, check for affected workflowsIf you temporarily disabled the Python Code node instead of upgrading, search your workflows for any that use it. Contact the workflow owners to understand if they need Python tasks, and plan the upgrade so those workflows can run again.

How to confirm it is fixed: Log in to n8n, go to Settings > About, and confirm the version is 1.123.32 or later (1.x line), 2.17.4 or later (2.17.x line), or 2.18.1 or later (2.18.x line).

SecurityElites Quick Fixes: copy and paste

Upgrade n8n with npmupgrade

npm install n8n@2.18.1
npm ls n8n

Check n8n version via npmfor this issue

npm list n8n

Disable Python Code node and Python Task Runner temporarily (environment variablfor this issue

export NODES_EXCLUDE=n8n-nodes-base.code
export PYTHONWORKER=false

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-42234) 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.

If a user with workflow editing rights is compromised, what could an attacker do with this vulnerability?A good answer: An attacker could create or modify a workflow with a Python Code Node to run arbitrary code on the task runner server, potentially stealing data, installing malware, or disrupting service.
What versions of n8n are safe from this vulnerability?A good answer: Versions 1.123.32 and later (on the 1.x line), 2.17.4 and later (on the 2.17.x line), and 2.18.1 and later (on the 2.18.x line) are safe; versions before these are affected.
What is the difference between the upgrade fix and the workaround disable options?A good answer: Upgrading closes the vulnerability and allows Python tasks to continue working safely; disabling Python Code Node or the Python Task Runner stops the vulnerability but also stops any workflows that use Python from running until you can upgr
If we cannot upgrade immediately, what should we do?A good answer: Restrict workflow creation and editing permissions to only fully trusted users, and optionally disable the Python Code node or Python Task Runner via environment variables as a temporary measure; both are short-term only and you must still

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 Python Code Node can run arbitrary code on the task runner (CVE-2026-42234)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01716 https://securityelites.com/ai-vulnerabilities/cve-2026-42234-n8n-python-code-node-can-run-arbitrary-code-on/

### Why this matters
An authenticated user who can create or change workflows could run any code on the server that runs Python tasks. This could lead to data theft, installation of malware, disruption of service, or use of the server to attack other systems. The risk applies only to instances where the Python Task Runner is turned on.

### What to do
1. Find your n8n version
2. Check if Python Task Runner is enabled
3. If Python is enabled and your version is affected, plan the upgrade
4. Back up your n8n instance
5. Upgrade n8n to the fixed version
6. Verify the upgrade was successful
7. Review workflow permissions
8. If you chose to disable Python instead, check for affected workflows

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-42234-n8n-python-code-node-can-run-arbitrary-code-on/

### Done when
- [ ] n8n is at 2.18.1 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Log in to n8n, go to Settings > About, and confirm the version is 1.123.32 or later (1.x line), 2.17.4 or later (2.17.x line), or 2.18.1 or later (2.18.x line).
- [ ] 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
  • 3 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.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.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-94

Use this record in your own tools

Get this record as JSON

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

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 3 Dec 2026. Read the vendor advisory before changing a production system.