CVE-2026-57998: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in jeemok better-npm-audit
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.
AI Analysis
Technical Summary
The better-npm-audit tool versions through 3.11.0 and the 4.0.0-rc.2 prerelease construct an npm audit command by directly embedding the user-supplied --registry option into a command string in src/handlers/handleInput.ts without proper validation or escaping. This command string is then passed to child_process.exec() in index.ts, which executes it in a shell. If the registry value contains shell metacharacters such as semicolons, pipes, or command substitutions, an attacker can execute arbitrary operating system commands with the same privileges as the process running the audit.
Potential Impact
An attacker who can control the --registry option can execute arbitrary OS commands on the system with the privileges of the better-npm-audit process. This can lead to unauthorized command execution, potentially compromising the host system. The vulnerability has a high severity with a CVSS 4.0 score of 8.5, reflecting high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid using untrusted input for the --registry option or running better-npm-audit in environments where untrusted users can influence this parameter. Monitor vendor channels for official patches or updates addressing this issue.
CVE-2026-57998: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in jeemok better-npm-audit
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.
CVSS v4.0
Score 8.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The better-npm-audit tool versions through 3.11.0 and the 4.0.0-rc.2 prerelease construct an npm audit command by directly embedding the user-supplied --registry option into a command string in src/handlers/handleInput.ts without proper validation or escaping. This command string is then passed to child_process.exec() in index.ts, which executes it in a shell. If the registry value contains shell metacharacters such as semicolons, pipes, or command substitutions, an attacker can execute arbitrary operating system commands with the same privileges as the process running the audit.
Potential Impact
An attacker who can control the --registry option can execute arbitrary OS commands on the system with the privileges of the better-npm-audit process. This can lead to unauthorized command execution, potentially compromising the host system. The vulnerability has a high severity with a CVSS 4.0 score of 8.5, reflecting high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid using untrusted input for the --registry option or running better-npm-audit in environments where untrusted users can influence this parameter. Monitor vendor channels for official patches or updates addressing this issue.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-06-26T17:58:05.796Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a899b98acd9273b490877f2
Added to database: 08/22/2026, 12:52:40 UTC
Last enriched: 08/22/2026, 13:07:29 UTC
Last updated: 08/23/2026, 00:09:49 UTC
Views: 10
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.