CVE-2026-55849

CVE-2026-55849 is a high-severity OS command injection vulnerability in @cyclonedx/cyclonedx-npm (npm), affecting versions >= 2.1.0, < 5.0.0. It is fixed in 5.0.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

@cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument

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.

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.

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.

Remediation

  • Upgrade to version 5.0.0 or later, which contains the complete fix.
  • As a temporary mitigation for older versions, ensure that the environment variable npm_execpath is set before invoking the tool.
  • Avoid passing untrusted or user‑controlled values to the --workspace option.

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-npm with --workspace <value>, and
  • The environment variable npm_execpath is unset or empty

Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.

Affected versions

@cyclonedx/cyclonedx-npm (>= 2.1.0, < 5.0.0)

Security releases

@cyclonedx/cyclonedx-npm → 5.0.0 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

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].

Frequently Asked Questions

  1. What is CVE-2026-55849? CVE-2026-55849 is a high-severity OS command injection vulnerability in @cyclonedx/cyclonedx-npm (npm), affecting versions >= 2.1.0, < 5.0.0. It is fixed in 5.0.0. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
  2. Which versions of @cyclonedx/cyclonedx-npm are affected by CVE-2026-55849? @cyclonedx/cyclonedx-npm (npm) versions >= 2.1.0, < 5.0.0 is affected.
  3. Is there a fix for CVE-2026-55849? Yes. CVE-2026-55849 is fixed in 5.0.0. Upgrade to this version or later.
  4. Is CVE-2026-55849 exploitable, and should I be worried? Whether CVE-2026-55849 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2026-55849 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2026-55849? Upgrade @cyclonedx/cyclonedx-npm to 5.0.0 or later.

Stop the waste.
Protect your environment with Kodem.