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

CVE-2026-49465: n8n Path Traversal Vulnerability

CVE-2026-49465 is a path traversal vulnerability in n8n workflow automation platform that allows authenticated users to bypass file access restrictions. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-49465 Overview

CVE-2026-49465 is a path traversal vulnerability [CWE-22] in n8n, an open source workflow automation platform. Authenticated users with workflow creation or modification permissions can supply a local filesystem path as the source repository in the Git node's Clone operation, or as the target repository in the Push operation. This bypasses the N8N_RESTRICT_FILE_ACCESS_TO sandbox that normally constrains file access by the n8n process. The flaw allows attackers to read the contents of any local Git repository accessible to the n8n process. Fixed releases are 1.123.48, 2.21.8, and 2.22.4.

Critical Impact

Authenticated workflow editors can exfiltrate the contents of arbitrary local Git repositories, bypassing the n8n file access sandbox and exposing source code, secrets, and configuration data.

Affected Products

  • n8n versions prior to 1.123.48
  • n8n versions prior to 2.21.8
  • n8n versions prior to 2.22.4

Discovery Timeline

  • 2026-06-23 - CVE-2026-49465 published to NVD
  • 2026-06-23 - Last updated in NVD database

Technical Details for CVE-2026-49465

Vulnerability Analysis

The vulnerability resides in the Git node component of n8n's workflow engine. The node accepts a repository parameter for both Clone and Push operations and treats local filesystem paths as valid Git remotes. n8n enforces a file sandbox through the N8N_RESTRICT_FILE_ACCESS_TO environment variable, which is intended to restrict the directories the n8n process can read or write. The Git node's repository input is not validated against this sandbox configuration before it is passed to the underlying Git command.

When an authenticated workflow author specifies a path such as a sensitive local repository as the Clone source, Git copies the contents into a target directory within the allowed sandbox path. The workflow then reads the cloned files normally because they now reside in a permitted location. The same flaw applies in reverse during Push, where data can be written to a local path outside the sandbox.

Root Cause

The root cause is missing input validation in the Git node's repository handling logic. The sandbox enforcement applies to direct file system APIs but not to spawned Git subprocesses that perform their own filesystem I/O. This is a classic [CWE-22] path traversal pattern, where a trusted operation is used as a confused deputy to relocate restricted data into an accessible location.

Attack Vector

An attacker requires authenticated access to n8n with permission to create or modify workflows. The attacker creates a workflow containing a Git node configured with a local repository path such as /var/lib/n8n-secrets/.git as the Clone source. After execution, the attacker reads the cloned data through subsequent nodes in the workflow. No user interaction is required beyond the attacker's own session. Refer to the GitHub Security Advisory for the maintainer's technical description.

Detection Methods for CVE-2026-49465

Indicators of Compromise

  • Workflow definitions referencing local filesystem paths (for example, paths beginning with /, file://, or absolute Windows paths) in Git node sourceRepository or targetRepository parameters.
  • git clone or git push child processes spawned by the n8n process with local path arguments outside the configured N8N_RESTRICT_FILE_ACCESS_TO directories.
  • Unexpected .git directory copies appearing inside n8n's allowed working directories.

Detection Strategies

  • Audit stored workflow JSON for Git nodes whose repository fields do not start with https://, git@, or ssh://.
  • Monitor process execution telemetry on the n8n host for git invocations whose arguments contain absolute local paths.
  • Review n8n execution logs for Clone or Push operations performed by accounts that do not normally use the Git node.

Monitoring Recommendations

  • Enable verbose execution logging for the Git node and forward logs to a centralized analytics platform for review.
  • Alert on file reads of sensitive directories such as /etc, /root, or application secret stores by the n8n service account.
  • Track creation and modification events for workflows by non-administrative users and flag those introducing Git nodes.

How to Mitigate CVE-2026-49465

Immediate Actions Required

  • Upgrade n8n to 1.123.48, 2.21.8, or 2.22.4 depending on your release channel.
  • Audit existing workflows for Git nodes referencing local filesystem paths and remove or rewrite them.
  • Rotate any credentials, tokens, or keys that may have resided in Git repositories accessible to the n8n process.

Patch Information

The maintainers fixed the vulnerability in n8n versions 1.123.48, 2.21.8, and 2.22.4. The patched releases validate the repository parameter and reject local filesystem paths that fall outside the N8N_RESTRICT_FILE_ACCESS_TO sandbox. Patch details are documented in the GitHub Security Advisory GHSA-5xp3-2w67-427v.

Workarounds

  • Restrict workflow creation and modification permissions to a minimal set of trusted users until the upgrade is applied.
  • Run the n8n process under a dedicated low-privilege account that cannot read sensitive local Git repositories or secret directories.
  • Set N8N_RESTRICT_FILE_ACCESS_TO to a tightly scoped directory and ensure no sensitive repositories reside on the same host.
bash
# Configuration example
export N8N_RESTRICT_FILE_ACCESS_TO="/var/lib/n8n/workflows"
sudo chown -R n8n:n8n /var/lib/n8n/workflows
sudo chmod 750 /var/lib/n8n/workflows
npm install -g n8n@2.22.4

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.