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.
Published: 2026-06-30
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is an abstract syntax tree validator bypass in the Python Code node of n8n. An authenticated user with permission to create or modify workflows can inject code that bypasses the AST check and gains access to the task executor module namespace, allowing the attacker to read environment variables exposed by the task runner process when N8N_BLOCK_RUNNER_ENV_ACCESS permits it. This can reveal sensitive configuration data and potentially be leveraged for further execution within the task runner context.

Affected Systems

The flaw affects self‑hosted n8n installations running versions prior to 2.25.7 and 2.26.x before 2.26.2. Only instances with the Python Task Runner enabled are vulnerable, as the bypass relies on that component.

Risk and Exploitability

The CVSS score of 5.3 indicates moderate severity. EPSS data is currently unavailable, and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires an authenticated session with workflow edit rights; once those credentials are held, the attacker can insert malicious Python code to disclose environment variables or otherwise manipulate the task runner environment. No public exploitation code is known, but the attack path is straightforward for legitimate users.

Generated by OpenCVE AI on June 30, 2026 at 23:36 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade n8n to version 2.25.7 or later 2.26.2 or newer to apply the vendor fix.
  • If an upgrade is not immediately possible, disable the Python Task Runner or set N8N_BLOCK_RUNNER_ENV_ACCESS to false to eliminate environment variable exposure.
  • Restrict workflow creation and modification permissions to the minimum set of users, ensuring only trusted accounts can edit Python Code nodes.
  • Monitor workflow changes for unfamiliar or suspicious Python Code nodes and review execution logs for anomalous activity.

Generated by OpenCVE AI on June 30, 2026 at 23:36 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 01 Jul 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 30 Jun 2026 22:45:00 +0000

Type Values Removed Values Added
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.
Title n8n - AST Validator Bypass in Python Code Node
First Time appeared N8n
N8n n8n
Weaknesses CWE-184
CPEs cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:*
Vendors & Products N8n
N8n n8n
References
Metrics cvssV3_1

{'score': 5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N'}

cvssV4_0

{'score': 5.3, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-01T13:49:32.546Z

Reserved: 2026-06-23T01:22:22.572Z

Link: CVE-2026-56777

cve-icon Vulnrichment

Updated: 2026-07-01T13:49:28.689Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-01T04:00:15Z

Weaknesses
  • CWE-184

    Incomplete List of Disallowed Inputs