8.5high
better-npm-audit OS Command Injection via registry flag
- Severity
- 8.5high CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.21% (higher than 11% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
Description
better-npm-audit through 3.11.0, and the 4.0.0-rc.2 prerelease, builds its npm audit command by interpolating the user-supplied --registry option into a command string in src/handlers/handleInput.ts without validation or quoting, then passes that string to child_process.exec() in index.ts, which spawns a shell. A registry value containing shell metacharacters such as a semicolon, pipe, or command substitution executes arbitrary operating system commands with the privileges of the process running the audit.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| jeemok better-npm-audit | up to 3.11.0, 4.0.0-rc.2 | CVE List |
All scores
| VulnCheck | 8.5high CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| VulnCheck | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
better-npm-audit through 3.11.0, and the 4.0.0-rc.2 prerelease, builds its npm audit command by interpolating the user-supplied --registry option into a command string in src/handlers/handleInput.ts without validation or quoting, then passes that string to child_process.exec() in index.ts, which spawns a shell. A registry value containing shell metacharacters such as a semicolon, pipe, or command substitution executes arbitrary operating system commands with the privileges of the process running the audit.
NVD (es)
better-npm-audit hasta la 3.11.0, y la versión preliminar 4.0.0-rc.2, construye su comando npm audit interpolando la opción --registry proporcionada por el usuario en una cadena de comando en src/hylers/hyleInput.ts sin validación ni entrecomillado, luego pasa esa cadena a child_process.exec() en index.ts, lo que genera un shell. Un valor de registro que contiene metacaracteres de shell como un punto y coma, una tubería o una sustitución de comando ejecuta comandos arbitrarios del sistema operativo con los privilegios del proceso que ejecuta la auditoría.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-57998 changed 2026-08-29 | CVE Terms of Use |
| NVD | CVE-2026-57998 changed 2026-10-12 | Public domain |