n8n Git Node Remote Code Execution via Malicious pre-commit Hook
CVE-2025-62726 is a remote code execution vulnerability in the Git Node component of n8n affecting both Cloud and Self-Hosted deployments prior to version 1.113.0. The issue occurs when an n8n workflow clones an attacker-controlled remote Git repository containing a malicious pre-commit hook and later performs a Commit operation through the Git Node. In that sequence, the hook can be executed automatically with the privileges of the n8n process, resulting in arbitrary code execution inside the n8n environment. Based on the provided content, the root cause is insufficient isolation or trust handling around Git hook execution from untrusted repositories, consistent with CWE-829.
Are you exposed to this one?
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
Impact, mitigation & remediation
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Mitigation
If you can’t patch tonight, do this now.
Remediation
Patch, then assume compromise.
Exploits
3 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (2 hidden).
This repository is a proof-of-concept exploit for CVE-2025-62726, targeting the n8n workflow automation platform (versions < 1.113.0). The exploit leverages a vulnerability in the n8n Git Node, which fails to sanitize or isolate git hooks when cloning repositories. The main workflow, defined in 'Deploy Application to Production - Backup.json', automates the process of cloning a repository, injecting a malicious pre-commit hook, and performing git operations that trigger the hook. The malicious hook opens a reverse shell to the attacker's machine (host.docker.internal:4444) using Node.js. The repository also includes a docker-compose.yml file to set up a vulnerable n8n instance for testing. The exploit demonstrates remote code execution via git hooks and is intended for educational purposes.
This repository contains a single file: a shell script intended as a git pre-commit hook. The script sets up a Node.js-based reverse shell that, when executed, connects to a specified attacker's IP address and port (defaulting to host.docker.internal:4444). Upon connection, it spawns a /bin/sh shell and redirects its input and output over the network socket, effectively granting the attacker remote shell access to the victim machine. The exploit is operational and requires the victim to execute the pre-commit hook, making it a local attack vector. The script is concise and leverages both shell scripting and Node.js for its payload. No specific CVEs or products are targeted; the exploit is generic and relies on social engineering or misconfiguration to be executed.
This repository is a comprehensive proof-of-concept (POC) for CVE-2025-62726, a critical remote code execution (RCE) vulnerability in n8n (versions < 1.113.0) when using the Git Node. The exploit leverages the fact that n8n's Git Node clones external repositories, including their .git/hooks directory, and executes git commit operations. If a malicious pre-commit hook is present, it is executed with the privileges of the n8n process, allowing arbitrary code execution. The repository is structured for educational and demonstration purposes, containing detailed guides, attack flow diagrams, mitigation instructions, and a realistic n8n workflow (n8n-workflow.json) that simulates a CI/CD deployment pipeline. The core exploit resides in the malicious-repo/.git/hooks/pre-commit file, which contains a reverse shell payload (or, in some variants, a credential harvester or remote payload fetcher). When the workflow is executed, the malicious hook is triggered, providing the attacker with a shell on the n8n container or exfiltrating sensitive data. Key files include: - malicious-repo/.git/hooks/pre-commit: The main payload (reverse shell or data exfiltration) - n8n-workflow.json: Workflow that clones the malicious repo and triggers the exploit - payloads/payload.sh: Standalone reverse shell payload - run-demo.sh, verify-setup.sh: Scripts to automate and verify the demo environment - docker-compose.yml: Spins up a vulnerable n8n instance for testing The exploit demonstrates a realistic supply chain attack scenario, where a seemingly legitimate repository is weaponized with a hidden git hook. The documentation provides step-by-step instructions for setup, exploitation, and mitigation, making it suitable for security training and awareness. The attack vector is network-based, requiring only low privileges (workflow creation) on the target n8n instance. The exploit is operational, with a working payload and clear demonstration of impact (RCE, credential theft, persistence).
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
Recent activity
10 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
Remote code execution (RCE) in n8n via the Git Node.
RCE in n8n Git Node where cloning a repository with a pre-commit hook can lead to arbitrary code execution within the n8n environment during commit operation.
RCE in n8n Git Node where cloning a repository with a pre-commit hook can lead to code execution during Git Node commit operation.
A remote code execution vulnerability in the Git Node component of n8n (prior to version 1.113.0) allows attackers to execute arbitrary code via malicious pre-commit hooks in cloned repositories.
The version that knows your environment.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.