n8n, Sandbox Bypass, Critical

Listen to this Post

How the mentioned vulnerability works:

The sandbox bypass vulnerability in n8n’s Python Code Node arises from the integration of Pyodide, a Python runtime for WebAssembly intended for browser-based sandboxing. When used server-side in n8n, Pyodide’s isolation mechanisms can be circumvented. An authenticated user with workflow permissions can inject Python code into the Code Node that exploits exposed interfaces or modules within Pyodide. For instance, by importing the ‘os’ module or using subprocess functions, the code can execute system commands. Pyodide may allow access to underlying JavaScript bridges or system calls due to improper sandboxing, enabling escape to the host environment. The n8n process, which runs Pyodide, typically has privileges on the host system, so any escaped commands inherit these privileges. This vulnerability transforms a confined code execution environment into remote code execution on the n8n server. The attack requires authentication and workflow modification rights, but in many deployments, such users are common, exacerbating the risk. The core issue is that Pyodide’s sandbox is not foolproof in server-side contexts, and n8n’s implementation lacked additional isolation layers, allowing malicious code to break out and run arbitrary commands.
Platform: n8n
Version: Before 1.111.0
Vulnerability: Sandbox bypass
Severity: Critical
Date: Not specified

Prediction: 2024-05-01

What Undercode Say:

Analytics

Bash commands for mitigation:

export NODES_EXCLUDE='[“n8n-nodes-base.code”]’

export N8N_PYTHON_ENABLED=false

export N8N_RUNNERS_ENABLED=true

export N8N_NATIVE_PYTHON_RUNNER=true

Example malicious Python code:

import os

os.system(‘id’)

How Exploit:

Authenticated user injects malicious Python code into Code Node to bypass Pyodide sandbox and execute host system commands.

Protection from this CVE

Update to n8n 1.111.0+, enable task-runner sandbox via environment variables, or disable Code Node/Python support.

Impact:

Arbitrary command execution on host, leading to full system compromise.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top