zm

How --exec got past simple-git's unsafe-pack guard

2026-12-04 · CVE-2026-134815 · Critical

simple-git is the package many Node projects use to run git commands from code. It is downloaded about 14 million times a week on npm. Before version 4.1.0, one of its safety guards could be bypassed with a single flag.

Packagesimple-git (npm)
Affectedbefore 4.1.0
Fixed in4.1.0
SeverityCritical, CVSS 4.0 score 9.2
WeaknessCWE-88, argument injection
CNAVulnCheck

What the guard was for

simple-git includes an allowUnsafePack guard. It is meant to block options that would make git run a program chosen by the caller. Without a guard like that, any application that lets someone influence git arguments could end up running commands on its own host.

What was wrong

The guard only applied to push operations. For other operations, the --exec option was not blocked. Anyone able to influence the arguments passed to listRemote() or raw() could add --exec to ls-remote, archive, fetch-pack or send-pack, and execute commands on the host with the permissions of the Node process.

Who is affected

You need both of these to be true:

  • You run simple-git older than 4.1.0.
  • Some part of what you pass to listRemote() or raw() can be influenced by someone you do not trust, for example a repository URL or option typed into a form, an API field or a webhook payload.

Code that passes only fixed, hard-coded arguments is not exposed through this path.

What to do

  • Upgrade to simple-git 4.1.0 or later.
  • Treat any argument that comes from outside your code as untrusted, even after upgrading. Prefer the library's structured methods over raw(), and validate values before they reach git.
  • If you cannot upgrade yet, do not pass user-controlled strings to listRemote() or raw().

Status and credit

The CVE was published on 2026-11-22 by VulnCheck. I am credited as the finder (Zachariah Mithani, AploSec). On AploSec this finding is labelled Reported: it was reported to the maintainer, and the public advisory and fix describe the evidence. That label does not claim independent reproduction.

References