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

CVE-2026-25115: n8n has a Python sandbox escape

criticalCVSS 4.0 9.4 · 3.1 9.9GHSA-8398-gmmx-564h

n8n before 2.4.8 has a Python sandbox escape in the Code node. An authenticated user who can run Python code through Task Runners can break out of the sandbox and execute code outside it. Only deployments with Task Runners and Python enabled are affected. Upgrade to 2.4.8.

Published Feb 4, 2026 · Updated Mar 25, 2026 · Analysis Nov 1, 2026

What an attacker can do

The Python Code node runs user-written code in a sandbox inside a Task Runner. The sandbox could be escaped, so the code ran outside the intended security boundary. The weakness is classed as a protection mechanism failure (CWE-693). The advisory's workaround mentions in-process memory disclosure from unsafe buffer allocations in internal mode.

The attacker needs an authenticated n8n account that can build and run workflows with a Code node. The deployment must have N8N_RUNNERS_ENABLED=true (default false), N8N_PYTHON_ENABLED=true, and the Code node enabled (default true). In the default internal runner mode the escape reaches the main n8n process, with its stored credentials and the host network. With N8N_RUNNERS_MODE=external, the escape stays in the sidecar container, which the maintainers say lowers the risk of lateral movement and warrants a lower, high severity. Scores are 9.4 (CVSS 4.0) and 9.9 (CVSS 3.1).

Who is affected

n8n below 2.4.8, only when all three are true: N8N_RUNNERS_ENABLED=true, N8N_PYTHON_ENABLED=true and the Code node is not excluded. Instances with Task Runners off, Python off or the Code node blocked are outside the described conditions.

n8n --version
npm ls n8n

Check your environment for N8N_RUNNERS_ENABLED, N8N_PYTHON_ENABLED and N8N_RUNNERS_MODE.

n8n

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

How to fix it

Upgrade to n8n 2.4.8 or later:

npm install -g n8n@latest

If you cannot upgrade right away, the advisory recommends two hardening steps:

  • Disable the Code node by adding n8n-nodes-base.code to the NODES_EXCLUDE environment variable.
  • Run Task Runners in external mode (N8N_RUNNERS_MODE=external), so untrusted task code runs in a separate sidecar container and not in the main n8n process.

How to tell if you were hit

Check which workflows use the Python Code node and who last edited them. Look for Task Runner processes spawning unexpected children, reading files such as the n8n config or .n8n data folder, or making unusual outbound connections. In external mode, inspect the sidecar container for the same. Review execution history for Code node runs from accounts that do not normally build workflows.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

A vulnerability in the Python Code node allows authenticated users to break out of the Python sandbox environment and execute code outside the intended security boundary.

Only authenticated users are able to execute code through Task Runners.

This issue affected any deployment in which the following conditions were met:

  • Task Runners were enabled using N8N_RUNNERS_ENABLED=true (default: false)
  • Python was enabled N8N_PYTHON_ENABLED=true
  • Code Node was enabled (default: true)

In case the N8N_RUNNERS_MODE is set to external (default: internal) the sandbox escape is limited to the sidecar container with lower risk for lateral movement. In that case a lower high severity is more appropriate.

Patches

This vulnerability is fixed in version 2.4.8 and later.

Workarounds

If an immediate upgrade cannot be applied, the following hardening steps are recommended:

  • Disable the Code Node by adding n8n-nodes-base.code to the NODES_EXCLUDE environment variable
  • Prefer external mode for isolation: run Task Runners in external mode so that untrusted task code executes in a separate sidecar container rather than within the main n8n process. This configuration significantly reduces the risk of in-process memory disclosure caused by unsafe buffer allocations.In external mode, a launcher manages Task Runner processes in a dedicated sidecar environment, separate from the primary n8n instance. See the [n8n documentation](https://docs.n8n.io/hosting/configuration/task-runners/) for configuration details and required environment variables.

Resources

Credited to MarcoPoloPie, c0rydoras.

Questions

Am I affected by CVE-2026-25115 with default settings?

Not by defaults alone. Task Runners are off by default (N8N_RUNNERS_ENABLED=false) and Python must be enabled with N8N_PYTHON_ENABLED=true. All three conditions in the advisory must hold.

Does external runner mode remove the risk?

It limits it. The escape is confined to the sidecar container, with lower risk of lateral movement, but you should still upgrade.

How do I disable the Code node?

Add n8n-nodes-base.code to the NODES_EXCLUDE environment variable, as the advisory describes.

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