Hoch

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

  • Veröffentlicht: 17.09.2026
  • Aktualisiert: 11.10.2026 10:22

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

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket @cyclonedx/cyclonedx-npm < 6.0.0 6.0.0

Verweise

CVSS-Wert -
CVSS-Vektor
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
Schwäche (CWE)
CWE-78
Plattform
npm
Paket
@cyclonedx/cyclonedx-npm
Veröffentlicht
17.09.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-q69g-4hcv-6jg4 - CC BY 4.0

Schwachstellenhistorie: @cyclonedx/cyclonedx-npm

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Einträge insgesamt
2
Erste → letzte
06.2026 09.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Hoch 2

Veröffentlichungen pro Jahr

  1. 2026: 2
  1. @cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument on Windows dieser Eintrag
    Hoch CVE-2026-71538 < 6.0.0 6.0.0

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.