CVE-2025-68668
CVE-2025-68668
Weakness (CWE)
CVSS Vector
v3.1- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- Low
- User Interaction
- None
- Scope
- Changed
- Confidentiality
- High
- Integrity
- High
- Availability
- Low
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.
Comprehensive Technical Analysis of CVE-2025-68668
1. Vulnerability Assessment and Severity Evaluation
CVE ID: CVE-2025-68668
Description: n8n, an open-source workflow automation platform, contains a sandbox bypass vulnerability in the Python Code Node that utilizes Pyodide. This vulnerability allows an authenticated user with permissions to create or modify workflows to execute arbitrary commands on the host system running n8n. The commands are executed with the same privileges as the n8n process.
CVSS Score: 9.9
Severity Evaluation: The CVSS score of 9.9 indicates a critical vulnerability. This high score is due to the potential for complete system compromise, including the execution of arbitrary commands with the privileges of the n8n process. The vulnerability requires authentication but can be exploited by any user with workflow creation or modification permissions.
2. Potential Attack Vectors and Exploitation Methods
Attack Vectors:
- Authenticated User Exploitation: An attacker with valid credentials and permissions to create or modify workflows can exploit this vulnerability.
- Malicious Workflow Creation: The attacker can create a workflow that includes malicious Python code, bypassing the sandbox and executing arbitrary commands on the host system.
Exploitation Methods:
- Command Injection: The attacker can inject commands into the Python code executed by the Code Node, leading to arbitrary command execution on the host system.
- Privilege Escalation: If the n8n process runs with elevated privileges, the attacker can escalate their privileges to those of the n8n process, potentially gaining full control over the system.
3. Affected Systems and Software Versions
Affected Versions:
- n8n versions from 1.0.0 to before 2.0.0
Patched Version:
- The vulnerability has been patched in version 2.0.0.
Workarounds:
- Disable the Code Node by setting the environment variable
NODES_EXCLUDE: "[\"n8n-nodes-base.code\"]". - Disable Python support in the Code Node by setting the environment variable
N8N_PYTHON_ENABLED=false, introduced in n8n version 1.104.0. - Configure n8n to use the task runner-based Python sandbox via the
N8N_RUNNERS_ENABLEDandN8N_NATIVE_PYTHON_RUNNERenvironment variables.
4. Recommended Mitigation Strategies
Immediate Actions:
- Upgrade to Version 2.0.0: Upgrade n8n to version 2.0.0 or later to apply the patch.
- Disable Code Node: If upgrading is not immediately possible, disable the Code Node by setting the environment variable
NODES_EXCLUDE: "[\"n8n-nodes-base.code\"]". - Disable Python Support: Disable Python support in the Code Node by setting the environment variable
N8N_PYTHON_ENABLED=false. - Use Task Runner Sandbox: Configure n8n to use the task runner-based Python sandbox via the
N8N_RUNNERS_ENABLEDandN8N_NATIVE_PYTHON_RUNNERenvironment variables.
Long-Term Strategies:
- Regular Patching: Implement a regular patching and update schedule for all software components.
- Least Privilege Principle: Ensure that the n8n process runs with the least privileges necessary to minimize the impact of potential exploits.
- Monitoring and Logging: Enhance monitoring and logging to detect and respond to suspicious activities related to workflow creation and modification.
5. Impact on Cybersecurity Landscape
Immediate Impact:
- Organizations using n8n for workflow automation are at risk of arbitrary command execution, which can lead to significant security breaches.
- The vulnerability highlights the importance of securing workflow automation platforms, especially those that allow code execution.
Long-Term Impact:
- Increased awareness of the risks associated with code execution in automation platforms.
- Emphasis on the need for robust sandboxing and privilege management in automation tools.
- Potential shift towards more secure alternatives or enhanced security features in existing platforms.
6. Technical Details for Security Professionals
Vulnerability Details:
- The vulnerability exists in the Python Code Node that uses Pyodide, a scientific Python compiler for WebAssembly.
- The sandbox mechanism intended to isolate code execution is bypassed, allowing arbitrary command execution.
Detection and Response:
- Detection: Implement intrusion detection systems (IDS) to monitor for unusual command execution patterns originating from the n8n process.
- Response: Develop incident response plans specifically for workflow automation platforms, including steps for isolating affected systems and mitigating the impact of command execution.
Security Best Practices:
- Code Review: Regularly review and audit code nodes and workflows for potential security issues.
- Access Control: Implement strict access controls to limit the number of users with workflow creation and modification permissions.
- Environment Hardening: Harden the environment in which n8n runs, including restricting network access and applying security patches promptly.
By addressing this vulnerability promptly and implementing robust security measures, organizations can mitigate the risks associated with CVE-2025-68668 and enhance the overall security of their workflow automation processes.