CVE-2021-23632

Public Exploit
Remote Code Execution (RCE)

Description

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.

Category

6.6
CVSS
Severity: Medium
CVSS 3.1 •
CVSS 2.0 •
EPSS 3.22% Top 15%
Third-Party Advisory snyk.io
Affected: n/a git
Published at:
Updated at:

References

Link Tags
https://snyk.io/vuln/SNYK-JS-GIT-1568518 third party advisory exploit

Frequently Asked Questions

What is the severity of CVE-2021-23632?
CVE-2021-23632 has been scored as a medium severity vulnerability.
How to fix CVE-2021-23632?
To fix CVE-2021-23632, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2021-23632 being actively exploited in the wild?
It is possible that CVE-2021-23632 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~3% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2021-23632?
CVE-2021-23632 affects n/a git.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.