CyberSecurityNews

Critical Node.js simple-git Library Vulnerability Enables Remote Code Execution Attacks


A critical flaw in simple-git, a popular Node.js library for running Git commands, can let attackers run their own commands on a server. The issue is tracked as CVE-2026-134815. It affects apps that pass untrusted input into Git arguments.

The National Vulnerability Database says simple-git versions before 4.1.0 contain an argument injection weakness, listed as CWE-88. In plain terms, the library does not properly separate user-supplied text from the options it sends to Git. VulnCheck, which assigned the CVE, rated it 9.2 (Critical) on the CVSS 4.0 scale.

The library has a safety guard named allowUnsafePack. It is meant to block dangerous options that make Git run an outside program. Before this fix, the guard only blocked the –exec option for push operations. Attackers can bypass it by adding –exec to other Git actions.

Node.js simple-git Library Flaw

The risk starts when an application lets outside input reach the listRemote() or raw() functions. An attacker who controls those arguments can slip in –exec for ls-remote, archive, fetch-pack or send-pack. Git then treats the value as the name of a remote program and runs it on the host. The result is remote code execution, which means the attacker’s commands run with the same rights as the Node.js process.

The CVSS vector shows the attack needs no login and no user interaction. It also lists high attack complexity and an attack requirement, so a vulnerable app must be set up in a specific way.

Even so, the impact on data, system integrity, and availability is rated high. A researcher write-up from Upwind describes the same bypass of the allowUnsafePack guard.

Two packages from the steveukx/git-js project are affected. These are simple-git below 4.1.0 and @simple-git/argv-parser below 3.0.0. The parser package holds the checks that spot dangerous flags, so both need updating together.

The maintainers shipped the fix in the simple-git 4.1.0 release on 16 November. The notes say allowUnsafePack now blocks –exec for every command except rebase. The release also adds allowConfig and strict options.

It adds a git.cmd helper too, which treats every inserted value as untrusted data that cannot add options or change settings. The maintainers thanked 18 contributors for submitting CVE proposals that shaped these changes. NVD published the record on 22 November.

This is not the first time simple-git has had trouble with argument handling. In 2022, CVE-2022-24433 showed that injecting Git options into fetch() could run commands. Earlier this year, CVE-2026-28292 used a missing case-insensitive regex flag to get around older fixes. The library sees more than 12 million weekly npm downloads.

Another advisory, CVE-2026-6951, covered an incomplete fix that blocked -c but not –config. The pattern is clear. Block lists of bad options are hard to keep complete, because Git accepts many ways to write the same option.

Upgrade to simple-git 4.1.0 and @simple-git/argv-parser 3.0.0 or later. Then run npm ls simple-git to find copies pulled in by other packages, since many projects use it indirectly.

Developers should also stop passing raw user input into listRemote() or raw(). Checking values against a fixed list of allowed repository URLs and branch names is a safer habit. Running the app as a low-rights user adds another layer of protection.

Node.js libraries that run system commands have been a steady source of serious problems. A command injection flaw in the systeminformation package followed the same idea of unchecked input reaching a shell.

Teams should also keep strict control of their dependencies, as shown when the Keyv package compromise reached millions of weekly installs. Use lockfiles, run npm ci in build systems, and review updates before they ship.

What Are Leading Organizations Doing About AI and Cyber Risks? Find Out. View Details!



Source link