🛡️ CVE-2026-55849 — cyclonedx-npm
Description
@cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument
Summary
A command injection vulnerability exists in @cyclonedx/cyclonedx-npm when the CLI is invoked with the --workspace <value> option while the environment variable npm_execpath is unset or empty.
User‑supplied --workspace values are passed to a subshell without proper sanitization, enabling attackers to inject arbitrary OS commands.
This issue corresponds to CWE‑78: Improper Neutralization of Special Elements used in an OS Command.
The vulnerability was fixed in version [5.0.0][v5.0.0].
Vulnerability Details
When cyclonedx-npm is executed with the --workspace option, the provided argument is incorporated into an internal shell command.
If the environment variable npm_execpath is set, the tool uses the npm executable directly and no injection occurs.
However, when npm_execpath is unset or empty, the tool falls back to spawning a subshell and interpolating the --workspace value directly into the command string without proper escaping or neutralization.
As a result, specially crafted workspace names can break out of the intended command context and execute arbitrary commands with the privileges of the invoking user.
Impact
An attacker who can influence the value passed to --workspace can execute arbitrary OS commands.
This may lead to:
- Arbitrary command execution
- Data exfiltration
- Local privilege escalation (depending on how the tool is used)
- Modification or destruction of files accessible to the user running the CLI
The vulnerability affects only scenarios where:
- The user invokes
cyclonedx-npmwith--workspace <value>, and - The environment variable
npm_execpathis unset or empty
Exploitation Conditions (High‑Level)
Exploitation requires the attacker to supply or influence the --workspace value passed to the CLI.
If the tool falls back to its subshell execution path, specially crafted workspace identifiers can cause unintended command execution.
No exploit code is included here to avoid providing weaponizable examples.
Root Cause
The CLI constructs a shell command using untrusted input from the --workspace option.
Because the fallback code path does not sanitize or escape the workspace value, special shell metacharacters (e.g., ;, &&, |) are interpreted by the shell, enabling command injection.
This behavior matches CWE‑78.
Fix
The vulnerability was resolved in [PR #1476], which ensures that workspace values are handled safely and are no longer passed to a subshell in an unsafe manner.
The fix is included in @cyclonedx/cyclonedx-npm version [5.0.0][v5.0.0].
Remediation
- Upgrade to version [5.0.0][v5.0.0] or later, which contains the complete fix.
- As a temporary mitigation for older versions, ensure that the environment variable
npm_execpathis set before invoking the tool. - Avoid passing untrusted or user‑controlled values to the
--workspaceoption.
[v5.0.0]: https://github.com/CycloneDX/cyclonedx-node-npm/releases/tag/v5.0.0
[PR #1476]: https://github.com/CycloneDX/cyclonedx-node-npm/pull/1476
How this vulnerability can be exploited
This issue can be reached with local access to the system, attack complexity is low, an attacker needs no privileges on the target. A user must be tricked into taking some action. Rated impact: confidentiality high, integrity high, availability high.
Weakness class
CVE-2026-55849 is classified as CWE-78: OS Command Injection. Untrusted input reaches a shell command without neutralisation, so an attacker can run arbitrary operating system commands.
Affected software
CVE-2026-55849 is recorded against 2 packages.
- @cyclonedx/cyclonedx-npm
- unknown
Timeline and source
Published on 19 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
References
github.com (Web)
github.com (Web)
github.com (Package)
github.com (Web)
Details
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
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| @cyclonedx/cyclonedx-npm | — | — |
| unknown | — | — |
References
More CVE 2026 advisories
Browse all of CVE 2026 in the advisory index.
Site Security Check
Is cyclonedx-npm part of your stack?
CVE-2026-55849 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.