/

CVE-2026-85168

Severity:

HIGH RISK

(8.8)

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

CVE-2026-85168

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

A command injection vulnerability in the n8n Git node allows Git configuration values from a repository to cause command execution during routine repository operations. An attacker who can provide or influence a repository with crafted local configuration may execute commands as the n8n process user.

Affected context

The vulnerability occurs in n8n versions that use the Git node to perform repository operations such as Add, Commit, Checkout, or Pull. It becomes risky when a repository's local Git configuration can reach the Git process and contains command-bearing content-filter or merge-driver settings with matching attribute patterns, while the node's configuration sanitization does not remove those key families.

Exploit preconditions

  • Attack surface: The n8n Git node and its repository operation workflow
  • Required access: Ability to cause n8n to process or operate on a repository containing attacker-controlled local Git configuration
  • Trigger point: An ordinary Add, Commit, Checkout, or Pull operation performed by the Git node
  • Why exploitation is possible: The node resets a fixed set of command-bearing configuration keys but does not cover content-filter and merge-driver key families, allowing Git to invoke configured commands when matching attributes are processed

Why this happens

The underlying bug is incomplete sanitization of command-capable Git configuration. The Git node attempted to clear a known list of dangerous configuration keys, but the allowlist or denylist did not cover all configuration families that can invoke external commands through Git attributes.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command or Argument, because attacker-influenced repository metadata can cause a trusted process to execute operating-system commands without sufficiently restricting the command-bearing behavior.

Potential impact

  • Arbitrary commands may execute with the privileges of the n8n process
  • The n8n runtime could be compromised
  • Credentials, workflow data, or environment variables could be exposed
  • An attacker could modify repositories, workflows, or generated artifacts
  • The host or surrounding services could be affected, depending on process privileges and network access

General mitigation guidance

Mitigation generally focuses on treating repositories and Git metadata as untrusted input and preventing Git from invoking external commands during automated operations.

Common defensive patterns include:

  • Using a strict allowlist of supported Git configuration and attribute behavior rather than clearing only known keys
  • Disabling or isolating Git features that invoke external filters, merge drivers, hooks, or helpers when they are not required
  • Processing repositories in disposable, sandboxed workers with minimal filesystem, network, and credential access
  • Separating repository-processing identities from administrative n8n services
  • Avoiding inherited credentials and reducing the runtime user's operating-system privileges
  • Validating repository provenance and content before automated Git operations
  • Applying secure-by-default Git configuration at the process and execution-environment boundaries

How teams detect issues like this

Detection approaches can include:

  • Static analysis for incomplete sanitization of command-bearing Git configuration families
  • Code review checks for repository operations performed on untrusted or user-supplied content
  • Tests using repositories with unusual attributes, filters, merge drivers, hooks, and helper settings to verify that external execution is blocked
  • Runtime monitoring for unexpected child processes spawned by the n8n process during Git activity
  • Policy enforcement that restricts repository sources, disables unnecessary Git extensions, and alerts on execution from workspace-controlled paths
  • Automated security review tools that identify command execution paths and insufficient input-trust boundaries

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-mwp5-2m32-r54h
vulncheck.comvulncheck.com/advisories/n8n-before-1.123.73-remote-code-execution-via-git-node

Frequently asked

questions

It can be reachable through a remote n8n workflow or service interface when an attacker can influence the repository processed by the Git node. The exact scope depends on repository-source controls and workflow permissions.

The attacker generally needs a way to provide or modify a repository that n8n will process, or to influence a repository operation involving attacker-controlled Git metadata. Direct access to the n8n host is not necessarily required.

Prevent Git from executing external commands from repository-controlled configuration and attributes, and ensure sanitization covers every command-capable configuration family rather than a partial list.

Treat Git repositories as untrusted input, use isolated least-privilege workers, restrict repository sources, test command-execution behavior during security review, and monitor automated Git processes for unexpected child processes.

Find out what's already
exploitable in your codebase.