NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · n8n

CVE-2025-65964: n8n vulnerable to Remote Code Execution via Git Node Custom Pre-Commit Hook

criticalCVSS 4.0 9.4GHSA-wpqc-h9wp-chmq

In n8n from 0.123.1 up to 1.119.2, a workflow can use the Git node's Add Config operation to set `core.hooksPath` to a folder in a cloned repository. Git then runs a hook such as `pre-commit` on the n8n host. Anyone who can create or edit workflows gets command execution. Fixed in n8n 1.119.2.

Published Dec 8, 2025 · Updated Dec 9, 2025 · Analysis Nov 1, 2026

What an attacker can do

The Git node lets a workflow set arbitrary Git configuration values. If the workflow sets core.hooksPath to a directory inside a repository it has cloned, and that directory holds an executable pre-commit hook, Git runs the hook on the next Git operation. Hooks are ordinary local commands, so the attacker gets arbitrary command execution on the n8n host with the n8n process's privileges.

The attacker needs the ability to create or modify a workflow that uses the Git node. They also need a repository containing the hook. That can be one they control and clone in the same workflow. No user interaction is needed. The CVSS 4.0 score of 9.4 reflects a changed scope: from n8n to everything the host and its stored credentials can reach.

On a shared n8n instance every workflow editor is therefore a potential host-level user. Teams that connect n8n to AI agents, cloud accounts and databases keep many secrets there.

Who is affected

npm package n8n >= 0.123.1, < 1.119.2. Only instances where someone can build workflows with the Git node are exposed, and the risk is highest where untrusted users or untrusted repositories are involved.

npm ls n8n

In Docker, run n8n --version inside the container.

n8n

Ecosystem
npm
Affected
>= 0.123.1, < 1.119.2
Fixed in
1.119.2
Check
npm ls n8n

How to fix it

Upgrade to n8n 1.119.2 or later:

npm install -g [email protected]

The fix commit turns Git hooks off by default in the Git node. It sets core.hooksPath=/dev/null unless the new setting N8N_GIT_NODE_ENABLE_HOOKS is true, and the default is false. Leave it unset.

Workarounds from the advisory if you cannot upgrade: exclude the Git node with NODES_EXCLUDE, and avoid cloning or working with untrusted repositories in the Git node.

How to tell if you were hit

Review workflows with Git nodes for an Add Config step that sets core.hooksPath, and for clones of repositories you do not own. On the host, look for hook files such as pre-commit in cloned repositories under the n8n working directories, and for child processes spawned by the n8n process that you do not expect. Check execution history for runs by editors who should not use the Git node. Rotate credentials stored in n8n if you find a hit.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

The n8n Git node allows workflows to set arbitrary Git configuration values through the _Add Config_ operation. When an attacker-controlled workflow sets core.hooksPath to a directory within the cloned repository containing a Git hook such as pre-commit, Git executes that hook during subsequent Git operations. Because Git hooks run as local system commands, this behavior can lead to arbitrary command execution on the underlying n8n host.

Successful exploitation requires the ability to create or modify an n8n workflow that uses the Git node.

Affected versions: ≥ 0.123.1 and < 1.119.2

Patches

This issue has been patched in n8n version 1.119.2.

All users running affected versions should upgrade to 1.119.2 or later.

Workarounds

If upgrading is not immediately possible, the following mitigations can reduce exposure:

  • Exclude the Git node (Docs).
  • Avoid cloning or interacting with untrusted repositories using the Git Node.

Credited to Malayke.

Questions

Does CVE-2025-65964 require authentication?

Yes, in the sense that the attacker must be able to create or modify an n8n workflow that uses the Git node. No further interaction is needed.

How does 1.119.2 stop it?

Hooks are disabled by default. The node sets core.hooksPath to /dev/null unless N8N_GIT_NODE_ENABLE_HOOKS is set to true.

Can I mitigate without upgrading?

Yes, partly. The advisory suggests excluding the Git node and not using it with untrusted repositories.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More n8n vulnerabilities

All n8n entries