VYPR
patchPublished Nov 24, 2026· 1 source

Critical Node.js simple-git Vulnerability Allows Remote Code Execution

A critical argument injection vulnerability (CVE-2026-134815) in the Node.js simple-git library, affecting versions before 4.1.0, allows remote code execution.

A critical flaw has been discovered in the popular Node.js library simple-git, which allows developers to interact with Git repositories. The vulnerability, tracked as CVE-2026-134815, enables remote code execution (RCE) when applications pass untrusted input into Git arguments. This issue arises because the library did not properly sanitize user-supplied text before passing it to Git commands, effectively allowing attackers to inject malicious commands.

The vulnerability affects simple-git versions prior to 4.1.0 and @simple-git/argv-parser versions prior to 3.0.0. The core of the problem lies in the allowUnsafePack guard, which was intended to prevent dangerous options that could execute external programs. However, this guard was not comprehensive, only blocking the --exec option for push operations. Attackers could bypass this by injecting --exec into other Git operations, such as listRemote(), raw(), ls-remote, archive, fetch-pack, or send-pack.

When an attacker successfully injects --exec, Git interprets the provided value as the name of a remote program to execute. This leads to arbitrary command execution on the host system, with the attacker's commands running with the same privileges as the Node.js process. The National Vulnerability Database (NVD) notes that the attack requires no authentication or user interaction, though it does list high attack complexity and specific attack requirements, meaning a vulnerable application must be configured in a particular way for exploitation to succeed.

Despite the attack complexity, the potential impact is severe, with high ratings for data integrity, system integrity, and availability. Researchers from Upwind detailed how the allowUnsafePack guard could be bypassed. The maintainers of simple-git have addressed this by releasing version 4.1.0 and @simple-git/argv-parser 3.0.0. The updated allowUnsafePack now blocks --exec for all commands except rebase, and new options like allowConfig and strict have been added for enhanced security.

This is not the first time simple-git has faced security issues related to argument handling. Previous vulnerabilities, such as CVE-2022-24433 and CVE-2026-28292, highlighted similar problems with command injection and bypassing security fixes. The frequent discovery of such flaws underscores the inherent difficulty in maintaining comprehensive blocklists for Git options, as Git offers numerous ways to express the same command or option.

With over 12 million weekly downloads on npm, simple-git is a widely used library, making this vulnerability a significant concern for many Node.js applications. Developers are strongly advised to upgrade to simple-git 4.1.0 and @simple-git/argv-parser 3.0.0 or later. Additionally, it is crucial to avoid passing raw user input directly into sensitive functions like listRemote() or raw(). Implementing safer practices, such as validating input against a predefined list of allowed repository URLs and branch names, and running applications with minimal privileges, can further mitigate risks.

The broader ecosystem of Node.js libraries that interact with system commands continues to be a source of critical security vulnerabilities. Similar command injection flaws have been observed in other packages, emphasizing the need for diligent dependency management. Practices like using lockfiles, running npm ci in build systems, and thoroughly reviewing package updates before deployment are essential for maintaining a secure software supply chain.

Synthesized by Vypr AI