/

CVE-2026-72767

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in n8n Git Workflows

CVE-2026-72767

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

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

n8n contains a remote code execution vulnerability in its Git node, where a crafted local repository can cause Git hooks to run commands under the n8n process account.

An authenticated user who can create and execute workflows may exploit this behavior, potentially compromising both self-hosted and cloud-hosted n8n environments.

Affected context

The vulnerability occurs in n8n workflows that use the Git node to operate on local repositories while Git's default hook behavior remains enabled. Exploitation generally requires an authenticated account with permissions to create and execute workflows and the ability to stage or reference a crafted repository. Both self-hosted and cloud deployments may be affected when these workflow capabilities are available.

Exploit preconditions

  • Attack surface: The n8n Git node and its repository-processing operations
  • Required access: An authenticated user with permission to create and execute workflows
  • Trigger point: Processing a crafted local Git repository during workflow execution
  • Why exploitation is possible: Git hooks may execute automatically under default security settings, and the resulting commands run with the privileges of the n8n process

Why this happens

The underlying bug is an unsafe interaction between workflow-controlled repository content and Git's hook execution behavior. Repository data is treated as operational input without sufficiently restricting executable Git features, allowing attacker-influenced hooks to invoke operating-system commands.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command or 'Command Injection', because untrusted repository content can influence command execution in the workflow runtime.

Potential impact

  • An attacker may execute arbitrary commands as the n8n process user
  • The n8n application runtime could be compromised
  • Workflow credentials, secrets, or connected-service data could be exposed
  • Self-hosted deployments could experience lateral movement or host compromise
  • Cloud instances could suffer tenant, workflow, or integration impact depending on isolation controls

General mitigation guidance

Mitigation generally focuses on preventing untrusted repository content from controlling executable Git behavior.

Common defensive patterns include:

  • Disable or isolate Git hook execution when repositories are processed by workflows
  • Use narrowly scoped repository-processing APIs and non-executable working directories
  • Treat workflow-authored repository paths and contents as untrusted input
  • Run n8n workers with least-privilege identities and minimal filesystem, network, and secret access
  • Separate workflow execution from sensitive control-plane and host resources
  • Apply strong authorization boundaries around workflow creation and execution
  • Prefer secure-by-default Git and sandbox configurations that do not permit repository content to launch commands

How teams detect issues like this

Organizations can look for:

  • Static analysis and code review checks for Git operations that process attacker-controlled repositories without hook restrictions
  • Runtime telemetry showing unexpected child processes launched by n8n workers or Git subprocesses
  • Audit events linking workflow executions to repository staging, hook activity, or unusual command processes
  • Policy enforcement that restricts Git-node use, local repository access, and workflow execution to approved roles
  • Alerts for n8n processes accessing sensitive files, credentials, or network destinations outside expected integration patterns

Automated security review tools may help identify command-execution paths and missing isolation controls.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-rcv6-pvrj-4xcg
vulncheck.comvulncheck.com/advisories/n8n-before-remote-code-execution-via-git-node

Frequently asked

questions

It can be remotely triggered through the n8n application when an attacker has authenticated access and the ability to create and execute workflows. The exact exposure depends on deployment access controls and repository-processing configuration.

The attacker generally needs an authenticated account with permissions to create and execute workflows, along with a way to stage or use a crafted local repository through the Git node.

Prevent repository content from executing Git hooks or other command paths, use secure-by-default repository-processing settings, and isolate workflow workers with least privilege.

Treat repositories and workflow inputs as untrusted, enforce role-based permissions, monitor subprocess creation, and apply sandboxing and policy controls around command-capable integrations.

Find out what's already
exploitable in your codebase.