/

CVE-2026-49465

Severity:

HIGH RISK

(7.7)

Path Traversal (CWE-22) in n8n Git Workflow Node

CVE-2026-49465

Analyzed

Vulnerability type

Category:

Path Traversal / Sandbox Escape

CWE:

CWE-22

Impact:

Unauthorized File Access / Sandbox Bypass

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal issue in n8n's Git workflow node allows authenticated users to bypass the N8N_RESTRICT_FILE_ACCESS_TO sandbox by specifying local filesystem paths as Git repository sources or targets.

When a user can create or modify workflows, they may clone or push from arbitrary local git repositories accessible to the n8n process, enabling unintended read access to restricted files.

Affected context

This vulnerability occurs in n8n instances where:

  • The Git node is available for use within workflows
  • File access is intended to be restricted via N8N_RESTRICT_FILE_ACCESS_TO or similar sandbox controls
  • Authenticated users can create or modify workflows that execute Git Clone or Push operations

Under these conditions, local repository paths that should be protected can still be indirectly exposed through Git operations.

Exploit preconditions

  • Attack surface: n8n web UI or API where workflows using the Git node can be defined and executed.
  • Required access: Authenticated access with permissions to create or modify workflows and run them.
  • Trigger point: Supplying a local filesystem path as the Git Clone source or Push target repository in a workflow.
  • Why exploitation is possible: The Git node validates repository paths for Git operations but does not consistently enforce the same path restrictions as direct file reads, allowing workflows to interact with repositories outside the declared sandbox.

Why this happens

The root cause aligns with CWE-22 (Path Traversal), where filesystem paths provided by users are not adequately constrained to a trusted directory set.

In this case, sandbox enforcement for direct file reads is implemented, but Git operations operate on user-controlled paths that can point to local repositories outside the sandbox.

The mismatch between path validation for file access and for Git node operations creates a secondary channel to reach sensitive directories, effectively bypassing the intended file access restrictions.

Potential impact

  • An authenticated user could read contents of any local git repository reachable by the n8n process.
  • Sensitive configuration, credentials, or proprietary code stored in local repositories may be exposed.
  • Internal application logic, infrastructure-as-code, or deployment scripts could be revealed and analyzed by a malicious insider.
  • Information leakage may facilitate further privilege escalation or lateral movement within the environment.

General mitigation guidance

Effective mitigation focuses on consistently enforcing filesystem access boundaries across all features that handle paths.

Recommended patterns include:

  • Centralizing path validation logic so all components, including Git nodes and file nodes, use the same sandbox enforcement.
  • Restricting workflow-supplied paths to a curated set of allowed directories, avoiding arbitrary local filesystem access.
  • Designing nodes that interact with repositories to operate on preconfigured, server-side repository definitions rather than user-supplied paths.
  • Applying least-privilege principles to the n8n process, limiting its visibility into sensitive directories and repositories.
  • Separating highly sensitive data or repositories onto isolated services or accounts that the automation platform cannot access.

How teams detect issues like this

Detection can focus on both configuration and runtime behavior:

  • Review workflow definitions for Git nodes using absolute or unexpected local paths and flag them for security review.
  • Use static or configuration analysis to identify node parameters that accept filesystem paths and confirm they are constrained to sandboxed directories.
  • Monitor logs for Git operations referencing paths outside the intended N8N_RESTRICT_FILE_ACCESS_TO scope.
  • Enforce policy checks in CI or deployment pipelines to prevent unsafe node configurations from being promoted to production.
  • Consider automated security review tools that scan workflow templates and node usage for path traversal or sandbox escape patterns.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-5xp3-2w67-427v

Frequently asked

questions

No, it primarily enables unauthorized reading of local git repositories accessible to the n8n process. While this can be serious, exploitation is constrained to information disclosure via repository contents rather than direct code execution.

An attacker must be an authenticated user with the ability to create or modify workflows that include the Git node and to run those workflows.

Consistently enforce a single sandbox and path validation layer across all features that touch the filesystem, ensuring that every component respects the same allowed directories and cannot operate on arbitrary user-specified paths.

Treat filesystem paths and repository locations as sensitive inputs, constrain them to predefined options, perform thorough threat modeling for new nodes or integrations, and add security-focused code reviews and automated checks for any feature that interacts with local files or repositories.

Find out what's already
exploitable in your codebase.