Description
@cyclonedx/cyclonedx-npm creates CycloneDX Software Bill of Materials from npm projects. From 2.1.0 before 5.0.0, the CLI passes user-supplied --workspace values to a subshell without proper sanitization when npm_execpath is unset or empty, allowing arbitrary OS command execution with the privileges of the invoking user. This issue is fixed in version 5.0.0.
Published: 2026-07-08
Score: 8.5 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability exists in the cyclonedx-node-npm command‑line tool, which creates CycloneDX Software Bill of Materials for npm projects. Between version 2.1.0 and just before version 5.0.0, the CLI forwards a user‑supplied --workspace value directly to a subshell without sanitization when the npm_execpath environment variable is unset or empty. This design flaw permits an attacker who can influence the --workspace argument to inject and execute arbitrary operating‑system commands with the privileges of the user running cyclonedx-node-npm. The flaw results in a classic OS command injection (CWE‑78), potentially exposing confidentiality, integrity, and availability of the host system if an attacker can supply malicious workspace paths.

Affected Systems

All installations of CycloneDX:cyclonedx-node-npm with versions ranging from 2.1.0 up to, but not including, 5.0.0 are susceptible. The issue was addressed in the 5.0.0 release, which sanitizes or removes the unsafe argument when npm_execpath is not defined.

Risk and Exploitability

The CVSS score of 8.5 indicates a high severity. The EPSS score of <1% suggests that exploitation attempts are currently rare, and the flaw is not listed in the CISA KEV catalog. Nonetheless, the vulnerability can be triggered locally by any user who can provide the --workspace parameter, such as during automated build or continuous‑integration processes that pass untrusted data to cyclonedx-node-npm. Consequently, the risk is significant enough to warrant immediate remediation.

Generated by OpenCVE AI on July 28, 2026 at 09:06 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update cyclonedx-node-npm to version 5.0.0 or later
  • If an immediate upgrade is not feasible, ensure that the npm_execpath environment variable is defined or that the --workspace option is omitted or restricted to trusted values in all scripts and CI configurations
  • Audit build pipelines and scripts to eliminate the use of untrusted --workspace arguments until the package is updated

Generated by OpenCVE AI on July 28, 2026 at 09:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-v75r-vx73-82pj @cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument
History

Fri, 10 Jul 2026 10:15:00 +0000

Type Values Removed Values Added
First Time appeared Cyclonedx
Cyclonedx cyclonedx Node Npm
Vendors & Products Cyclonedx
Cyclonedx cyclonedx Node Npm

Thu, 09 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 08 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
Description @cyclonedx/cyclonedx-npm creates CycloneDX Software Bill of Materials from npm projects. From 2.1.0 before 5.0.0, the CLI passes user-supplied --workspace values to a subshell without proper sanitization when npm_execpath is unset or empty, allowing arbitrary OS command execution with the privileges of the invoking user. This issue is fixed in version 5.0.0.
Title @cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized `--workspace` Argument
Weaknesses CWE-78
References
Metrics 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

Cyclonedx Cyclonedx Node Npm
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-09T19:36:40.011Z

Reserved: 2026-06-17T16:44:40.994Z

Link: CVE-2026-55849

cve-icon Vulnrichment

Updated: 2026-07-09T19:36:36.494Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-28T09:15:06Z

Weaknesses
  • CWE-78

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