CVE-2026-57998
better-npm-audit through 3.11.0, and the 4.0.0-rc.2 prerelease, …
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.
What to do now
- Check your exposureFind out whether the affected software runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Set the orderSystems that can be reached from the internet come first, then the rest.
References
- github.com/jeemok/better-npm-audit
- github.com/jeemok/better-npm-audit/blob/fd99a0f41ff4342b8a0a6fdbe5a17261de3d0544/index.ts#
- github.com/jeemok/better-npm-audit/blob/fd99a0f41ff4342b8a0a6fdbe5a17261de3d0544/src/handl
- github.com/jeemok/better-npm-audit/issues/119
- github.com/jeemok/better-npm-audit/pull/120
- www.vulncheck.com/advisories/better-npm-audit-os-command-injection-via-registry-flag
- nvd.nist.gov/vuln/detail/CVE-2026-57998
- cve.org/CVERecord?id=CVE-2026-57998
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.