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.
Published: 2026-08-22
Score: 8.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Remote OS Command Execution
Action: Immediate Patch
AI Analysis

Impact

better‑npm‑audit builds its npm audit command by inserting the user‑supplied --registry value directly into a shell command string and passes that string to child_process.exec(), which launches a shell. Because the registry argument is not validated or quoted, a value that contains shell metacharacters such as ;, | or $(…) can cause arbitrary operating‑system commands to run with the same privileges as the audit process. This flaw allows a malicious user to execute system commands on the host that runs the audit, leading to full compromise of the container, VM, or developer machine where the tool is invoked.

Affected Systems

This vulnerability exists in jeemok better‑npm‑audit up through version 3.11.0 and the 4.0.0‑rc.2 prerelease. All installations running these or earlier releases are affected. No information is available about whether newer releases include the fix, so uncertainty remains about the status of later versions.

Risk and Exploitability

The CVSS score of 8.5 indicates a high severity. EPSS data is not provided, and the vulnerability is not listed in the CISA KEV catalog. The attack vector is a local or semi‑remote action; it is inferred that anyone who can invoke the tool can supply a malicious --registry flag, thereby triggering the command execution. The exploitation process requires only the ability to run the audit command with a crafted registry option; no network service or elevated privileges are necessary for the initial trigger. Once triggered, the attacker gains the same shell access as the audit process, which can be sufficient to compromise the host, exfiltrate data, or modify the environment.

Generated by OpenCVE AI on August 22, 2026 at 14:50 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade better‑npm‑audit to a newer release that includes validated handling of the --registry option.
  • If upgrading is not possible, patch the source code: remove direct interpolation into the command string and instead use child_process.spawn or execFile with the registry value as a separate argument, ensuring that any special characters are escaped or validated before execution.
  • Run the audit tool under the least privileged user in an isolated environment such as a container or virtual machine, and restrict network access to limit the potential impact of command execution.

Generated by OpenCVE AI on August 22, 2026 at 14:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 27 Aug 2026 18:00:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Sun, 23 Aug 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Jeemok
Jeemok better-npm-audit
Vendors & Products Jeemok
Jeemok better-npm-audit

Sat, 22 Aug 2026 12:45:00 +0000

Type Values Removed Values Added
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.
Title better-npm-audit OS Command Injection via registry flag
Weaknesses CWE-78
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.5, 'vector': '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'}


Subscriptions

Jeemok Better-npm-audit
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-29T11:47:30.693Z

Reserved: 2026-06-26T17:58:05.796Z

Link: CVE-2026-57998

cve-icon Vulnrichment

Updated: 2026-08-25T16:43:12.393Z

cve-icon NVD

Status : Received

Published: 2026-08-22T13:16:38.263

Modified: 2026-08-25T17:17:33.827

Link: CVE-2026-57998

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-23T16:40:01Z

Weaknesses
  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')