CVE-2021-23632
JSON

6.6medium

Remote Code Execution (RCE)

Severity
6.6medium CVSS:3.1 by snyk
Exploit likelihood
2.35% (higher than 84% of CVEs)
Published
Last changed
Assigned by
snyk
Also known as
GHSA-9gqr-xp86-f87hSNYK-JS-GIT-1568518

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.

Affected

Product or packageVersionsReported by
gitbefore unspecifiedCVE List
git (npm)up to 0.1.5GitHub Advisory Database
git_project gitup to 0.1.5NVD

All scores

snyk6.6medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H
GitHub6.6medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:P

Classification

What each source says

CVE List

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.

GitHub Advisory Database

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. At this time, there is no known workaround. There has been no patch released.

NVD (es)

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

References

Sources

SourceRecordLicence
CVE ListCVE-2021-23632 changed 2024-09-16CVE Terms of Use
GitHub Advisory DatabaseGHSA-9gqr-xp86-f87h changed 2026-07-08CC-BY-4.0
NVDCVE-2021-23632 changed 2026-06-17Public domain