5.3medium
n8n - AST Validator Bypass in Python Code Node
- Severity
- 5.3medium CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.30% (higher than 24% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- GHSA-jwm3-qcfw-c5pp
Description
n8n before 2.25.7 and 2.26.x before 2.26.2 contains an abstract syntax tree (AST) security validator bypass in the Python Code node. An authenticated user with permission to create or modify workflows containing a Python Code node can bypass the validator and access the task executor module namespace. The issue only affects self-hosted instances where the Python Task Runner is enabled; where N8N_BLOCK_RUNNER_ENV_ACCESS is configured to allow it, this can disclose environment variables accessible to the task runner process.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| n8n n8n | from 2.26.0 before 2.26.2, before 2.25.7 Not affected: 2.26.2, 2.25.7 | CVE List, NVD |
| n8n (npm) | from 2.26.0 before 2.26.2, before 2.25.7 | GitHub Advisory Database |
All scores
| VulnCheck | 5.3medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N |
| VulnCheck | 5.0medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N |
| GitHub | 5.0medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N |
Classification
What each source says
CVE List
n8n before 2.25.7 and 2.26.x before 2.26.2 contains an abstract syntax tree (AST) security validator bypass in the Python Code node. An authenticated user with permission to create or modify workflows containing a Python Code node can bypass the validator and access the task executor module namespace. The issue only affects self-hosted instances where the Python Task Runner is enabled; where N8N_BLOCK_RUNNER_ENV_ACCESS is configured to allow it, this can disclose environment variables accessible to the task runner process.
GitHub Advisory Database
Impact
An authenticated user with permission to create or modify workflows containing a Python Code node could bypass the AST security validator and access the task executor module namespace. On self-hosted instances where N8N_BLOCK_RUNNER_ENV_ACCESS=false is set, this extended to disclosure of environment variables accessible to the task runner process.
This issue only affects instances where the Python Task Runner is enabled and N8N_BLOCK_RUNNER_ENV_ACCESS=true.
Patches
The issue has been fixed in n8n versions 2.25.7, and 2.26.2. 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.codeto theNODES_EXCLUDEenvironment 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.
NVD (es)
n8n anterior a 2.25.7 y 2.26.x anterior a 2.26.2 contiene una omisión del validador de seguridad del árbol de sintaxis abstracta (AST) en el nodo de Código Python. Un usuario autenticado con permiso para crear o modificar flujos de trabajo que contengan un nodo de Código Python puede omitir el validador y acceder al espacio de nombres del módulo ejecutor de tareas. El problema solo afecta a instancias autoalojadas donde el Ejecutor de Tareas Python está habilitado; donde N8N_BLOCK_RUNNER_ENV_ACCESS está configurado para permitirlo, esto puede divulgar variables de entorno accesibles para el proceso del ejecutor de tareas.
References
| https://github.com/n8n-io/n8n/security/advisories/GHSA-jwm3-qcfw-c5pp | mitigation, vendor-advisory, web | |
| https://www.vulncheck.com/advisories/n8n-ast-validator-bypass-in-python-code-node | third-party-advisory | |
| https://github.com/n8n-io/n8n | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-56777 changed 2026-10-29 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jwm3-qcfw-c5pp changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2026-56777 changed 2026-10-29 | Public domain |