CVE-2026-65598 in n8n
Summary
by MITRE • 07/22/2026
n8n before 1.123.64, 2.29.8, and 2.30.1 contains a TOCTOU race condition in the Git node's clone operation that allows authenticated users to bypass path restrictions by swapping a directory for a symlink after the path is validated but before the clone runs. This lets an attacker plant a crafted repository in the community node directory, which n8n loads as a custom node on the next restart, executing arbitrary JavaScript on the server. Both self-hosted and cloud instances are affected.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 07/22/2026
The vulnerability under discussion represents a critical race condition flaw affecting n8n versions prior to 1.123.64, 2.29.8, and 2.30.1, specifically within the Git node's clone operation mechanism. This issue constitutes a time-of-check to time-of-use vulnerability that fundamentally undermines the system's path validation security controls. The flaw occurs when the application validates a directory path for cloning operations but fails to maintain consistency between the validation phase and the actual execution phase, creating a window of opportunity for malicious exploitation.
The technical implementation of this vulnerability involves an authenticated user leveraging a race condition between the path validation check and the subsequent Git clone operation. During the validation phase, the system properly checks and accepts a directory path as valid, but immediately after this check completes and before the actual clone process begins, an attacker can replace the validated directory with a symbolic link pointing to an unauthorized location. This manipulation allows the Git clone operation to proceed into a restricted or privileged directory, effectively bypassing all intended access controls and path restrictions that were established during the initial validation.
The operational impact of this vulnerability extends across both self-hosted deployments and cloud instances, making it particularly concerning for organizations relying on n8n for workflow automation. When exploited successfully, this race condition enables attackers to plant maliciously crafted repositories within the community node directory structure. The n8n application, upon restarting, automatically loads these custom nodes from the community directory, resulting in the execution of arbitrary JavaScript code on the server. This scenario fundamentally transforms a legitimate workflow automation platform into an attack vector capable of executing remote code execution payloads with the privileges of the n8n process.
The security implications align with CWE-367 Time-of-Check to Time-of-Use (TOCTOU) vulnerability classification, which specifically addresses situations where application behavior changes between validation and execution phases. From an adversarial perspective, this vulnerability maps directly to ATT&CK technique T1059.007 Command and Scripting Interpreter: JavaScript, as it enables remote code execution through JavaScript payload delivery within the n8n node system. The attack chain demonstrates how a seemingly minor implementation oversight in path validation can create a complete compromise path from authenticated access to persistent server-side code execution.
Mitigation strategies should focus on implementing atomic operations that prevent directory replacement during the validation-to-execution window, such as using file system locks or atomic move operations for repository management. Organizations should immediately upgrade to patched versions of n8n where the race condition has been resolved through proper synchronization mechanisms between path validation and Git clone execution. Additionally, security monitoring should be enhanced to detect unauthorized modifications to community node directories, particularly around restart events when custom nodes are loaded. Network segmentation and privilege separation should also be considered as defensive measures to limit the impact of successful exploitation attempts.