Security Disaster on the n8n Automation Platform (January 2026)

Search for a command to run...

No comments yet. Be the first to comment.
Tổng Quan Một chiến dịch tấn công bằng dòng mã độc tống tiền mới mang tên Spirals đã ghi nhận vụ việc đầu tiên mã hóa thành công toàn bộ hệ thống của một công ty dịch vụ IT tại Nam Á chỉ trong vòng ch

Tóm tắt rủi ro Bạn bảo một web agent: "tóm tắt giúp tôi các review trên trang này". Một review giả do kẻ tấn công đăng lên khiến agent bấm nhầm nút "Buy Now", và đơn hàng được đặt. Không malware, khôn

Campaign Summary A Russian-speaking criminal group tracked by Cisco Talos as UAT-11795 has been running a continuous campaign since at least June 2025, distributing malware inside trojanized installer

Tóm tắt chiến dịch Nhóm tội phạm nói tiếng Nga được Cisco Talos theo dõi dưới định danh UAT-11795 đã hoạt động liên tục từ ít nhất tháng 06/2025, phát tán mã độc thông qua các bộ cài đặt phần mềm hợp

Tóm Tắt Chiến Dịch Vào ngày 14/07/2026, kẻ tấn công đã xâm nhập thành công tổ chức AsyncAPI trên npm — một trong những dự án mã nguồn mở phổ biến nhất cho các API event-driven, và tiêm mã độc vào 4 gó

In January 2026, the open-source and DevOps communities were shaken by the disclosure of two critical security vulnerabilities in n8n—currently the world's most popular workflow automation platform. The combination of these flaws creates a "doomsday" scenario for unpatched systems: ranging from unauthenticated attacks to privilege escalation that grants total server control.
Below is a detailed technical breakdown of these two security nightmares: "Ni8mare" (CVE-2026-21858) and the Sandbox Escape (CVE-2025-68668).
Discovered by Cyera Research Labs, this vulnerability scored a perfect 10.0/10 on the CVSS scale. This rare score is reserved for vulnerabilities that allow Remote Code Execution (RCE) without authentication, without user interaction, and with low attack complexity.
The core of this vulnerability lies in how n8n processes heterogeneous HTTP requests, specifically involving Content-Type confusion.
Middleware Mismatch: The n8n application uses middleware to handle file uploads (typically multipart/form-data). However, an attacker can send a specially crafted HTTP request where the body contains file data, but the Content-Type header is spoofed (e.g., declared as application/json despite the structure being different).
Parameter Injection: Due to this confusion, the system fails to process the file through the standard secure pipeline, allowing the attacker's input to directly overwrite the internal req.body.files object in n8n's backend code.
Path Traversal: Once req.body.files is controlled, the attacker manipulates the file path parameter (filepath). Instead of pointing to a temporary uploaded file, they point this path to sensitive system files on the server.
Attackers exploit this vulnerability via a 4-step process to achieve "Full Instance Takeover":
Step 1: Data Exfiltration: Leveraging the Path Traversal flaw, the attacker forces n8n to read configuration files (config) or the internal database (typically SQLite at /home/node/.n8n/database.sqlite).
Step 2: Credential Theft: From the exposed database, they extract user lists, password hashes, and most importantly, authentication secrets/encryption keys.
Step 3: Session Forgery: Using the stolen secrets, the attacker cryptographically signs a valid authentication cookie, impersonating the system Administrator.
Step 4: Remote Code Execution (RCE): Once logged in as Admin, the attacker simply creates a new workflow, adds an "Execute Command" node (a native n8n feature), and runs any Linux command they desire (e.g., installing backdoors, crypto mining, or wiping data).
If "Ni8mare" is the external threat, CVE-2025-68668 demonstrates that even valid users can be dangerous. This is a privilege escalation vulnerability achieved by breaking out of the isolated environment.
n8n allows users to write custom code using JavaScript or Python. For security, this Python code is executed within an isolated environment called a Sandbox (using Pyodide—a Python port running on WebAssembly) to prevent user code from accessing the host operating system.
Pyodide Implementation Flaw: The Pyodide integration in n8n versions v1.0.0 up to (but not including) v2.0.0 contains a flaw in its access control mechanism.
System Command Execution: An authenticated user (who has permissions to create workflows) can write a specific Python script in the "Code Node." This script exploits the flaw to "jump" out of the WebAssembly/Pyodide boundary and interact directly with the host operating system's Shell.
Impact: The attacker can execute commands with the privileges of the n8n process (often root inside a Docker container or the n8n user).
Compromising an n8n server is far more dangerous than hacking a standard website due to the nature of the tool:
Central Connectivity Hub: n8n is designed to connect everything. A single n8n server often stores API Keys, OAuth Tokens, and Database Credentials for dozens of other services like Google Sheets, Slack, AWS, OpenAI, Salesforce, etc.
Pivot Point: From n8n, an attacker can easily conduct lateral movement attacks into other internal systems that n8n has access to.
Sensitive Data Stream: Workflows often process critical business data (orders, customer PII, internal emails) passing through n8n in real-time.
To combat the severity of these vulnerabilities, system administrators must implement a multi-layered defense strategy immediately.
This is the only way to permanently resolve the issues:
Upgrade immediately to n8n v2.0.0 or later.
Version 2.0.0 changes the architecture, making the "Task Runner" the default for Python, which completely isolates code execution and prevents CVE-2025-68668.
Patches for CVE-2026-21858 (the parser flaw) are also included in the latest updates (from 1.121.0 onwards).
If production environments cannot be upgraded immediately, apply the following environment variables to lock down vulnerable features:
Disable Code Node completely (If unused):
bashexport NODES_EXCLUDE="[\"n8n-nodes-base.code\"]"
Disable Python in Code Node (Blocks CVE-2025-68668):
bashexport N8N_PYTHON_ENABLED=false
Manually Enable Task Runner (For v1.x):
bashexport N8N_RUNNERS_ENABLED=true
export N8N_NATIVE_PYTHON_RUNNER=true
No Public Exposure: Never expose the n8n Dashboard directly to the public Internet.
Use VPN/Tunnel: Only allow access via internal VPNs or Zero Trust solutions (like Cloudflare Tunnel, Tailscale).
Basic Auth/Reverse Proxy: Place an additional authentication layer (e.g., Nginx Basic Auth) in front of n8n to block exploit requests from strangers, even if n8n itself remains unpatched.