Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-65598

CVE-2026-65598: n8n Race Condition Vulnerability

CVE-2026-65598 is a TOCTOU race condition flaw in n8n's Git node that allows attackers to bypass path restrictions and execute arbitrary code on the server. This post covers its technical details, affected versions, and mitigation.

Published:

CVE-2026-65598 Overview

CVE-2026-65598 is a Time-of-Check Time-of-Use (TOCTOU) race condition [CWE-367] in the n8n workflow automation platform. The flaw resides in the Git node's clone operation, which validates a destination path before executing the clone. Authenticated attackers can swap the validated directory for a symbolic link between the check and the clone, bypassing path restrictions. This allows an attacker to plant a crafted repository inside the community node directory. On the next n8n restart, the platform loads the malicious code as a custom node, executing arbitrary JavaScript on the server. Both self-hosted and cloud n8n deployments are affected.

Critical Impact

Authenticated attackers achieve remote code execution on n8n servers by exploiting a symlink race in the Git node, leading to full host compromise.

Affected Products

  • n8n versions prior to 1.123.64
  • n8n versions prior to 2.29.8
  • n8n versions prior to 2.30.1 (self-hosted and cloud)

Discovery Timeline

  • 2026-07-22 - CVE-2026-65598 published to NVD
  • 2026-07-22 - Last updated in NVD database

Technical Details for CVE-2026-65598

Vulnerability Analysis

The vulnerability is a TOCTOU race condition in the n8n Git node's clone workflow. n8n validates the clone destination path to ensure it stays within permitted directories. After validation succeeds, the code proceeds to invoke the underlying Git clone operation. Between these two operations, the filesystem state can be modified by another concurrent action.

An authenticated attacker with permission to execute Git node operations exploits this gap by replacing the validated directory with a symbolic link pointing to a sensitive location such as the community node directory. When the clone runs, it follows the symlink and writes the repository contents outside the intended sandbox.

The planted repository contains attacker-controlled JavaScript structured as an n8n community node. On the next n8n restart, the loader enumerates the community node directory and executes the malicious node code in the n8n process context, resulting in remote code execution.

Root Cause

The root cause is non-atomic path validation. The code performs the safety check and the filesystem write as two separate operations without holding a lock or resolving the final canonical path immediately before use. This allows filesystem state manipulation between check and use.

Attack Vector

Exploitation requires network access to the n8n instance and low-privilege authentication sufficient to trigger a Git node clone. The attacker races the clone operation, swapping a directory for a symlink to the community node path. Persistence requires an n8n restart, after which the crafted node loads and executes attacker-supplied JavaScript.

No verified public exploit code is available. Refer to the GitHub Security Advisory GHSA-g3r5-9h93-4j2c and the VulnCheck Security Advisory for additional technical detail.

Detection Methods for CVE-2026-65598

Indicators of Compromise

  • Unexpected symbolic links inside n8n working directories, particularly links pointing at the community node directory.
  • New or modified files under the n8n custom/community node path that were not installed through the standard node management interface.
  • Git node executions from user accounts that do not normally use Git integrations, especially with repeated clone attempts to the same target path.

Detection Strategies

  • Audit n8n execution logs for Git node clone operations correlated with filesystem events creating symlinks in the same time window.
  • Monitor the n8n community node directory for unauthorized additions and inspect package.json entries for suspicious main scripts.
  • Alert on n8n process restarts followed by anomalous outbound network activity or child process creation.

Monitoring Recommendations

  • Enable filesystem integrity monitoring on n8n data and community node directories.
  • Forward n8n audit logs and host process telemetry to a centralized analytics platform for correlation.
  • Track authenticated user activity for privilege patterns consistent with Git node abuse.

How to Mitigate CVE-2026-65598

Immediate Actions Required

  • Upgrade n8n to version 1.123.64, 2.29.8, 2.30.1, or later, depending on the release branch in use.
  • Review the community node directory for unauthorized packages and remove any not installed through approved channels.
  • Rotate credentials and API keys stored in n8n if compromise is suspected, since successful exploitation grants full server access.

Patch Information

n8n has released fixed versions 1.123.64, 2.29.8, and 2.30.1. Details are published in the GitHub Security Advisory GHSA-g3r5-9h93-4j2c. Cloud instances managed by n8n are updated by the vendor; self-hosted operators must apply the patch manually.

Workarounds

  • Restrict Git node usage to trusted administrators by adjusting role-based access controls until patching is complete.
  • Run the n8n process as a low-privilege user with a read-only filesystem outside required working directories to limit symlink abuse.
  • Disable community node loading via the N8N_COMMUNITY_PACKAGES_ENABLED=false environment variable where community nodes are not required.
bash
# Disable community node loading as a temporary mitigation
export N8N_COMMUNITY_PACKAGES_ENABLED=false
systemctl restart n8n

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.