NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · n8n

CVE-2026-49444: n8n: Python sandbox escape

highCVSS 4.0 7.1 · 3.1 8.5GHSA-9pq8-m8gp-4p53

A user who can create or edit n8n workflows can break out of the Python Code node sandbox and run arbitrary code on the task runner container. Only instances with the Python Task Runner enabled are affected. Fixed in n8n 1.123.48, 2.21.8 and 2.22.4.

Published Jun 16, 2026 · Updated Jul 20, 2026 · Analysis Oct 26, 2026

What an attacker can do

The Python Code node runs user-written Python in a sandbox on a task runner. The advisory says a crafted workflow can escape that sandbox and execute arbitrary code in the task runner container. It does not describe the escape technique, the control that was bypassed, or give a proof of concept, and it lists CWE-20 (improper input validation).

The attacker must be authenticated and hold permission to create or modify workflows that contain a Python Code node. No user interaction is needed. The scope is marked changed in CVSS 3.1 (8.5) because code in the runner container reaches beyond the sandbox boundary. The listed impact is high confidentiality and low integrity.

In practice, any teammate, contractor or compromised account with workflow-edit rights can turn that permission into code execution in the runner. What an attacker can then reach depends on how the runner is deployed: its environment variables, mounted volumes, network access to internal services, and credentials passed to it. Instances where many people edit workflows are the most exposed.

Who is affected

n8n on npm in these ranges: below 1.123.48; from 2.0.0-rc.0 below 2.21.8; and from 2.22.0 below 2.22.4. Exposure requires the Python Task Runner to be enabled. Check:

npm ls n8n
n8n --version

For Docker, check the image tag. Also check whether you run a task runner with Python support.

n8n

Ecosystem
npm
Affected
< 1.123.48
Fixed in
1.123.48
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.22.0, < 2.22.4
Fixed in
2.22.4
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.0.0-rc.0, < 2.21.8
Fixed in
2.21.8
Check
npm ls n8n

How to fix it

Upgrade to 1.123.48, 2.21.8 or 2.22.4, or later on your branch:

npm install -g n8n@latest

For Docker, pull a newer n8nio/n8n image. The advisory gives two temporary mitigations that do not fully remove the risk: 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 entirely.

How to tell if you were hit

The advisory gives no indicators. Review workflows that contain Python Code nodes and who last edited them, looking for code that imports os, subprocess, ctypes or similar, reads environment variables, or opens network connections. On the task runner container, look for unexpected processes, file writes outside its working directory, and outbound connections. Check workflow history for edits by accounts that do not normally build workflows.

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

Credited to vipinxsec.

Questions

Does CVE-2026-49444 affect n8n without the Python Task Runner?

No. The advisory says only instances with the Python Task Runner enabled are affected.

Does the attacker need a login?

Yes. They need an account with permission to create or modify workflows that include a Python Code node. No further user interaction is required.

Which versions fix it?

1.123.48, 2.21.8 and 2.22.4, or later releases.

Is it exploited in the wild?

The sources do not report exploitation, and the entry has no CISA KEV data.

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 entries