CVE-2025-62726: n8n Vulnerable to Remote Code Execution via Git Node Pre-Commit Hook
n8n's Git node can run attacker code: if a workflow clones a repository that carries a pre-commit hook and then uses the Commit operation, the hook can execute inside the n8n environment. Fixed in n8n 1.113.0, which adds N8N_GIT_NODE_DISABLE_BARE_REPOS; self-hosters should set it to true.
Published Oct 30, 2025 · Analysis Nov 1, 2026
What an attacker can do
The Git node clones a remote repository, and a later Commit operation can fire a Git hook that came with that repository. A hook is an arbitrary script, so the attacker's repository content becomes code running as the n8n process. The advisory says this affects both n8n Cloud and self-hosted instances, and any workflow that clones untrusted repositories.
The attacker needs a repository the workflow will clone, which may be one they control or one they can push to, and a workflow that clones and then commits. The CVSS vector lists low privileges, which fits an attacker who can edit workflows or influence the repository URL. With code running on the n8n host, they can read credentials stored in n8n and environment variables, and change workflows and reach connected systems. The CVSS rates confidentiality, integrity and availability as high.
The fix in PR 19559 adds support for turning off bare-repository handling in the Git node.
Who is affected
n8n on npm before 1.113.0, on Cloud or self-hosted, where workflows use the Git node to clone repositories you do not fully trust and then run the Commit operation.
npm ls n8n
n8n --versionFor Docker, check the image tag. Search your workflows for Git nodes that clone from external URLs.
n8n
- Ecosystem
- npm
- Affected
- < 1.113.0
- Fixed in
- 1.113.0
- Check
npm ls n8n
How to fix it
Upgrade to n8n 1.113.0 or later:
npm install -g [email protected]The release adds the environment variable N8N_GIT_NODE_DISABLE_BARE_REPOS. For self-hosted instances, the advisory strongly recommends setting it to true. Per the pull request, bare repositories are disabled entirely on n8n Cloud, and n8n prints a startup warning when the variable has no value.
Before upgrading, avoid cloning or interacting with untrusted repositories in the Git node, and disable or restrict the node in workflows where repository content cannot be trusted.
How to tell if you were hit
Find workflows with a Git node that clones and then commits, and check where the clone URL comes from. Inspect the repositories they cloned for hooks/pre-commit or other hook files, and for a bare-repository layout. On the host, look for child processes spawned by the n8n process around Commit executions, such as shells, curl or wget, and for unexpected outbound connections or new files in the n8n data directory. After upgrading, check the startup log for the warning about the unset variable.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
A remote code execution vulnerability exists in the Git Node component available in both Cloud and Self-Hosted versions of n8n. When a malicious actor clones a remote repository containing a pre-commit hook, the subsequent use of the Commit operation in the Git Node can inadvertently trigger the hook’s execution.
This allows attackers to execute arbitrary code within the n8n environment, potentially compromising the system and any connected credentials or workflows.
All users with workflows that utilize the Git Node to clone untrusted repositories are affected.
Patches
The vulnerability was addressed in v1.113.0 (n8n-io/n8n#19559), which introduces a new environment variable: N8N_GIT_NODE_DISABLE_BARE_REPOS. For self-hosted deployments, it is strongly recommended to set this variable to true to mitigate the risk of executing malicious Git hooks.
Workarounds
To reduce risk prior to upgrading:
- Avoid cloning or interacting with untrusted repositories using the Git Node.
- Disable or restrict the use of the Git Node in workflows where repository content cannot be fully trusted.
Credited to assaf-levkovich-jf.
Questions
- Does CVE-2025-62726 affect n8n Cloud?
The advisory says the Git node flaw exists in both Cloud and self-hosted versions. The fix disables bare repositories on Cloud entirely, and self-hosters must set N8N_GIT_NODE_DISABLE_BARE_REPOS to true.
- Is my workflow at risk if it only clones a repository?
The advisory describes the hook running on the subsequent Commit operation after cloning. Workflows that clone untrusted repositories are named as affected, so avoid cloning untrusted sources at all.
- Which version fixes it?
n8n 1.113.0, which introduced N8N_GIT_NODE_DISABLE_BARE_REPOS. Any version before 1.113.0 is vulnerable.
References
Read for this analysis:
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 entriesCVE-2026-86073
n8n: Per-Resource OAuth Consent Bypass via Unbound Refresh Token Resource Substitution
medium5.9Sep 10, 2026CVE-2026-86074
n8n: Instance AI Credential Setup Accepts Unvalidated Probe URL from Fetched Content
medium5.9Sep 10, 2026CVE-2026-86075
n8n: Unauthenticated Persistent Storage Exhaustion via OAuth Dynamic Client Registration Endpoint
high8.7Sep 10, 2026CVE-2026-86076
n8n: Expression Sandbox Escape via Class-Field Sanitizer Rebinding Can Lead to Code Execution
high8.7Sep 10, 2026CVE-2026-86077
n8n: Anonymous Approval-Gate Bypass via Reused resumeToken over the Chat WebSocket
medium6.3Sep 10, 2026CVE-2026-86078
n8n: Prototype Pollution via Workflow Structure Summary Can Lead to Denial of Service
medium6.0Sep 10, 2026
