CVE-2026-56777·Python vulnerability
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.
- Severity
- medium
- Software
- Python
- Fixed in
- 2.26.2
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.25% — higher than 16% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
From: 2.26.0
Until: 2.26.2
Fixed in: 2.26.2
How to fix this CVE
Update n8n to version 2.26.2 or later to patch the AST validator bypass in the Python Code node. If you are running a self-hosted n8n instance with the Python Task Runner enabled, prioritize this update to prevent authenticated users from circumventing security restrictions and accessing sensitive task executor namespaces and environment variables. Review your N8N_BLOCK_RUNNER_ENV_ACCESS configuration after patching to ensure it aligns with your security policies.
sudo dnf update n8nDefensia detects this vulnerability
WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Implement rate limiting and request inspection on /api/v1/workflows endpoints to detect rapid creation or modification of workflows containing Python Code nodes by a single authenticated user; block requests that include obfuscated or eval-like patterns in the pythonCode field.How to check if you are affected
- Step 1: Check your n8n version by running: curl -s http://localhost:5678/api/v1/me | grep -i version or check the n8n UI under Settings > About
- Step 2: Verify if Python Task Runner is enabled by checking your n8n environment: env | grep -i RUNNER or review your docker-compose.yml for RUNNERS configuration
- Step 3: Review audit logs for Python Code nodes created or modified by authenticated users between the vulnerability disclosure and your patch date: grep -r 'pythonCode' ~/.n8n/logs/ or your centralized logging system
- Step 4: After applying the update to n8n 2.26.2+, confirm the version: curl -s http://localhost:5678/api/v1/me | jq '.data.settings.version' and test that Python Code nodes reject AST bypass attempts
FAQ
What is CVE-2026-56777?
This vulnerability is an abstract syntax tree (AST) validator bypass in n8n's Python Code node that allows authenticated users to escape sandbox restrictions and access the underlying task executor module namespace, potentially exposing environment variables if the Python Task Runner is enabled.
Is CVE-2026-56777 being actively exploited?
No, this CVE is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploit code is available, but it should still be patched promptly since it requires only authentication to trigger.
What versions of n8n are affected by CVE-2026-56777?
Versions 2.26.0, 2.26.1, and 2.26.2 (pre-patch) are affected. The fixed version is 2.26.2 and later. Earlier branches before 2.25.7 may also be vulnerable depending on your deployment.
How do I check if my server is vulnerable to CVE-2026-56777?
Run: curl -s http://localhost:5678/api/v1/me | jq '.data.settings.version' and check if the result is between 2.26.0 and 2.26.1. Also confirm Python Task Runner is enabled by checking your environment variables for RUNNERS configuration.
Does Defensia detect CVE-2026-56777?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If n8n is installed on a monitored server, CVE-2026-56777 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-56777. Free for 1 server.
Get started free