medium CVSS 5 EPSS 0.25%

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 n8n

Defensia 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

  1. 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
  2. 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
  3. 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
  4. 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

CVE-2026-28505CVSS 10Tautulli is a Python based monitoring and tracking tool for Plex Media Server. Prior to version 2.17.0, the str_eval() function in notification_handler.py implements a sandboxed eval() for notification text templates. The sandbox attempts to restrict callable names by inspecting code.co_names of the compiled code object. However, co_names only contains names from the outer code object. When a lambda expression is used, it creates a nested code object whose attribute accesses are stored in code.co_consts, NOT in code.co_names. The sandbox never inspects nested code objects. This issue has been patched in version 2.17.0.
CVE-2026-34938CVSS 10PraisonAI is a multi-agent teams system. Prior to version 1.5.90, execute_code() in praisonai-agents runs attacker-controlled Python inside a three-layer sandbox that can be fully bypassed by passing a str subclass with an overridden startswith() method to the _safe_getattr wrapper, achieving arbitrary OS command execution on the host. This issue has been patched in version 1.5.90.
CVE-2026-33054CVSS 10Mesop is a Python-based UI framework that allows users to build web applications. Versions 1.2.2 and below contain a Path Traversal vulnerability that allows any user supplying an untrusted state_token through the UI stream payload to arbitrarily target files on the disk under the standard file-based runtime backend. This can result in application denial of service (via crash loops when reading non-msgpack target files as configurations), or arbitrary file manipulation. This vulnerability heavily exposes systems hosted utilizing FileStateSessionBackend. Unauthorized malicious actors could interact with arbitrary payloads overwriting or explicitly removing underlying service resources natively outside the application bounds. This issue has been fixed in version 1.2.3.
CVE-2026-25632CVSS 10EPyT-Flow is a Python package designed for the easy generation of hydraulic and water quality scenario data of water distribution networks. Prior to 0.16.1, EPyT-Flow’s REST API parses attacker-controlled JSON request bodies using a custom deserializer (my_load_from_json) that supports a type field. When type is present, the deserializer dynamically imports an attacker-specified module/class and instantiates it with attacker-supplied arguments. This allows invoking dangerous classes such as subprocess.Popen, which can lead to OS command execution during JSON parsing. This also affects the loading of JSON files. This vulnerability is fixed in 0.16.1.
CVE-2026-26030CVSS 9.9Semantic Kernel, Microsoft's semantic kernel Python SDK, has a remote code execution vulnerability in versions prior to 1.39.4, specifically within the `InMemoryVectorStore` filter functionality. The problem has been fixed in version `python-1.39.4`. Users should upgrade this version or higher. As a workaround, avoid using `InMemoryVectorStore` for production scenarios.

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