Miggo Logo

CVE-2025-62726: n8n Vulnerable to Remote Code Execution via Git Node Pre-Commit Hook

8.8

CVSS Score
3.1

Basic Information

EPSS Score
0.42737%
Published
10/30/2025
Updated
10/30/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
n8nnpm< 1.113.01.113.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability exists in the Git node of n8n, where it was possible to execute arbitrary code via git hooks. The provided patch for CVE-2025-62726 shows that the execute method of the Git class in packages/nodes-base/nodes/Git/Git.node.ts was modified. The change involves adding a configuration to the simple-git library to disable bare repositories, which is the attack vector for the pre-commit hook execution. The execute function is the main function for the node's operation and is the place where the vulnerable call to the git library is made. Therefore, Git.execute is the vulnerable function that would appear in a runtime profile during exploitation.

Vulnerable functions

Git.execute
packages/nodes-base/nodes/Git/Git.node.ts
The `execute` method in the `Git` node is vulnerable to remote code execution. It uses the `simple-git` library to perform git operations. Before the patch, it did not restrict the use of bare repositories, which could contain malicious pre-commit hooks. An attacker could create a repository with a malicious hook, and when a user clones this repository using the Git node, the hook would be executed on the n8n instance, leading to RCE. The patch introduces a check to disable bare repositories by adding `safe.bareRepository=explicit` to the git configuration, thus preventing the execution of such hooks.

WAF Protection Rules

WAF Rule

### Imp**t * r*mot* *o** *x**ution vuln*r**ility *xists in t** *it No** *ompon*nt *v*il**l* in *ot* *lou* *n* S*l*-*ost** v*rsions o* n*n. W**n * m*li*ious **tor *lon*s * r*mot* r*pository *ont*inin* * pr*-*ommit *ook, t** su*s*qu*nt us* o* t** *ommi

Reasoning

T** vuln*r**ility *xists in t** `*it` no** o* n*n, w**r* it w*s possi*l* to *x**ut* *r*itr*ry *o** vi* *it *ooks. T** provi*** p*t** *or *V*-****-***** s*ows t**t t** `*x**ut*` m*t*o* o* t** `*it` *l*ss in `p**k***s/no**s-**s*/no**s/*it/*it.no**.ts`