simple-git arbitrary command execution (CVE-2026-28291)
CVE-2026-28291
simple-git enables running native Git commands from JavaScript. Versions up to and including 3.31.1 allow execution of arbitrary commands through Git option manipulation, bypassing safety checks meant...
Overview
A high-severity command injection vulnerability, tracked as CVE-2026-28291, has been patched in the popular simple-git JavaScript library. This library provides a high-level API for running Git commands from within Node.js applications. The flaw allows an attacker to bypass built-in safety checks and execute arbitrary commands on the host system.
Vulnerability Details
The vulnerability is a bypass of a previous fix for CVE-2022-25860. simple-git includes an “unsafe operations” plugin designed to block dangerous Git command-line options, such as --upload-pack (-u), which could be used to run unintended commands. The blocklist used a regular expression to detect these options.
However, Git’s command-line parser is highly flexible, accepting numerous character combinations for the same option (e.g., -vu, -4u, -nu). An attacker could craft malicious Git arguments that include these dangerous options in a format that evades the blocklist’s pattern matching, leading to the execution of arbitrary system commands.
Impact and Severity
This vulnerability has a CVSS score of 8.1 (High). It is network-exploitable, requires no privileges, and needs no user interaction, making it a significant risk for applications that process untrusted input and use simple-git. A successful exploit could lead to full compromise of the underlying server, data theft, or deployment of ransomware. While not currently listed on CISA’s Known Exploited Vulnerabilities catalog, the potential for abuse is high.
Affected Versions and Remediation
All versions of simple-git up to and including 3.31.1 are vulnerable.
Primary Fix: The only complete remediation is to upgrade simple-git to version 3.32.0 or later. Update your project’s dependencies using your package manager (npm or yarn).
Verification: After updating, verify your package.json file lists "simple-git": "^3.32.0" and that no older versions are present in your node_modules directory. You can run npm list simple-git to check the installed version.
Mitigation (If Patching is Delayed): If immediate updating is impossible, review and sanitize all user inputs that are passed to simple-git functions. However, input validation is error-prone and should not be considered a substitute for applying the official patch.
Security Insight
This vulnerability highlights the inherent risk of blocklist-based security, especially when defending against a complex parser like Git’s. The failure to fully emulate Git’s argument parsing allowed a previous fix to be circumvented, suggesting that similar libraries interfacing with powerful native tools may need to adopt more robust allowlisting or sandboxing strategies. For more on how software flaws can lead to major incidents, review recent breach reports.
Further Reading
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Related Advisories
Unsanitized input in an OS command in the virtual desktop session name handling in AWS Research and Engineering Studio (RES) version 2025.03 through 2025.12.01 might allow a remote authenticated actor...
Nginx UI is a web user interface for the Nginx web server. In versions 2.3.3 and prior, Nginx-UI contains an Insecure Direct Object Reference (IDOR) vulnerability that allows any authenticated user to...
An issue in Datart v1.0.0-rc.3 allows attackers to execute arbitrary code via the url parameter in the JDBC configuration...
A improper neutralization of special elements used in an os command ('os command injection') vulnerability in Fortinet FortiSandbox 4.4.0 through 4.4.8 may allow attacker to execute unauthorized code ...