GHSA-q69g-4hcv-6jg4: OS Command Injection

Published Sep 17, 2026
·
Updated

Summary

A Windows-specific command injection vulnerability exists in @cyclonedx/cyclonedx-npm when the CLI is invoked with the --workspace <value> option. User-supplied --workspace values can be passed to a shell command without proper neutralization on the Windows fallback execution path, enabling attackers to inject arbitrary OS commands.

The vulnerability was fixed in version [6.0.0][v6.0.0].

Vulnerability Details

When cyclonedx-npm is executed with the --workspace option, the provided argument is incorporated into an internal command execution flow. On Windows systems, this path can interpret untrusted --workspace input as shell syntax if not safely handled.

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 on Windows hosts. This may lead to:

Arbitrary command execution Data exfiltration Local privilege escalation (depending on runtime context and privileges) 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 vulnerable execution path is reached on Windows.

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 the vulnerable shell execution path on Windows, specially crafted workspace identifiers can cause unintended command execution. No exploit code is included here to avoid providing weaponizable examples.

Root Cause

The CLI fallback execution path on Windows constructed 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.

Fix

The vulnerability was resolved in [PR #1489], which ensures workspace values are handled safely and are no longer passed to a vulnerable shell execution path.

The fix is included in @cyclonedx/cyclonedx-npm version [6.0.0][v6.0.0].

Remediation

Upgrade to version [6.0.0][v6.0.0] or later, which contains the complete fix. As a temporary mitigation for older versions, ensure that the environment variable npmexecpath is set to a npm-cli.js before invoking the tool. Avoid passing untrusted or user-controlled values to the --workspace option. If immediate upgrade is not possible, prioritize mitigation on Windows systems, where exploitability exists.

Affected Software

1 affected componentFixes available
npm/@cyclonedx/cyclonedx-npm<6.0.0
6.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@cyclonedx/cyclonedx-npm to a version that resolves this vulnerability.

    Fixed in 6.0.0
  2. Upgrade

    Upgrade @cyclonedx/cyclonedx-npm to a version that resolves this vulnerability.

    Fixed in 6.0.0
  3. Configuration

    As a temporary mitigation for older versions, ensure the environment variable npm_execpath is set to a npm-cli.js before invoking the tool.

    @cyclonedx/cyclonedx-npm npm_execpath = npm-cli.js
  4. Configuration

    Avoid passing untrusted or user-controlled values to the --workspace option.

    @cyclonedx/cyclonedx-npm --workspace = (do not use untrusted/user-controlled values)
  5. Compensating control

    If immediate upgrade is not possible, prioritize mitigation on Windows systems, where exploitability exists (Windows fallback execution path can interpret untrusted --workspace input as shell syntax).

Event History

Sep 17, 2026
Advisory Published
via GitHub·02:50 PM
Data Sourced
via GitHub·02:50 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which environments are exposed to this issue?

Only Windows hosts are affected, and only when cyclonedx-npm is invoked with the --workspace option. The vulnerable execution path is the Windows fallback command-execution path.

2

What must an attacker control to exploit it?

An attacker must be able to influence the value supplied to --workspace. A crafted value can be interpreted as shell syntax and execute arbitrary OS commands with the privileges of the user running cyclonedx-npm.

3

What version contains the fix?

The vulnerability was fixed in version 6.0.0.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203