{"id":"CVE-2026-71538","aliases":["EUVD-2026-81665","GHSA-q69g-4hcv-6jg4"],"status":"published","title":"@cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument on Windows","description":"@cyclonedx/cyclonedx-npm creates CycloneDX Software Bill of Materials from npm projects. Prior to version 6.0.0, the Windows fallback path in src/npmRunner.ts, used when npm_execpath does not provide the npm CLI path, can construct a shell command containing an untrusted value from the --workspace option. When an attacker can influence that option and the fallback npm execution path is reached, shell metacharacters in the workspace value can execute arbitrary operating-system commands with the privileges of the user running the CLI, allowing data access, file modification, or service disruption. This issue is fixed in version 6.0.0.","severity":{"version":"4.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","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00212,"percentile":0.1155,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-78"],"published":"2026-09-17T14:35:39Z","modified":"2026-10-28T02:30:24Z","fixes":[{"ecosystem":"npm","package":"@cyclonedx/cyclonedx-npm","fixed_in":["6.0.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@cyclonedx/cyclonedx-npm","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.0.0"}]}]},{"source":"osv","ecosystem":"npm","package":"@cyclonedx/cyclonedx-npm","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"6.0.0"}]}]}],"products":[{"vendor":"cyclonedx","product":"cyclonedx-node-npm"}],"references":[{"url":"https://github.com/CycloneDX/cyclonedx-node-npm/security/advisories/GHSA-q69g-4hcv-6jg4","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/CycloneDX/cyclonedx-node-npm/pull/1489","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/CycloneDX/cyclonedx-node-npm/commit/15d3beb5bcd2b0b6eccfdf31192f5103b3f12c0f","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/CycloneDX/cyclonedx-node-npm/releases/tag/v6.0.0","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/advisories/GHSA-q69g-4hcv-6jg4"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/71xxx/CVE-2026-71538.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-71538","tags":["advisory"]},{"url":"https://github.com/CycloneDX/cyclonedx-node-npm","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-71538","title":"@cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument on Windows","description":"@cyclonedx/cyclonedx-npm creates CycloneDX Software Bill of Materials from npm projects. Prior to version 6.0.0, the Windows fallback path in src/npmRunner.ts, used when npm_execpath does not provide the npm CLI path, can construct a shell command containing an untrusted value from the --workspace option. When an attacker can influence that option and the fallback npm execution path is reached, shell metacharacters in the workspace value can execute arbitrary operating-system commands with the privileges of the user running the CLI, allowing data access, file modification, or service disruption. This issue is fixed in version 6.0.0.","status":"published","published":"2026-09-17T14:35:39.144Z","modified":"2026-09-17T15:30:52.84Z","cvss":[{"version":"4.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","level":"high","assessor":"cna"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:19:49.559463Z"}],"euvd":[{"id":"EUVD-2026-81665","description":"@cyclonedx/cyclonedx-npm creates CycloneDX Software Bill of Materials from npm projects. Prior to version 6.0.0, the Windows fallback path in src/npmRunner.ts, used when npm_execpath does not provide the npm CLI path, can construct a shell command containing an untrusted value from the --workspace option. When an attacker can influence that option and the fallback npm execution path is reached, shell metacharacters in the workspace value can execute arbitrary operating-system commands with the privileges of the user running the CLI, allowing data access, file modification, or service disruption. This issue is fixed in version 6.0.0.","status":"published","published":"2026-09-17T14:35:39Z","modified":"2026-09-17T15:30:52Z","cvss":[{"version":"4.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","level":"high"}],"updated_at":"2026-11-02T17:28:11.273554Z"}],"ghsa":[{"id":"GHSA-q69g-4hcv-6jg4","title":"@cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument on Windows","description":"## Summary\n\nA **Windows-specific** command injection vulnerability exists in `@cyclonedx/cyclonedx-npm` when the CLI is invoked with the `--workspace \u003cvalue\u003e` option.  \nUser-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.  \n\nThe vulnerability was fixed in version [6.0.0][v6.0.0].\n\n## Vulnerability Details\n\nWhen `cyclonedx-npm` is executed with the `--workspace` option, the provided argument is incorporated into an internal command execution flow.  \nOn **Windows systems**, this path can interpret untrusted `--workspace` input as shell syntax if not safely handled.\n\nAs 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.\n\n## Impact\n\nAn attacker who can influence the value passed to `--workspace` can execute arbitrary OS commands **on Windows hosts**.  \nThis may lead to:\n\n* Arbitrary command execution\n* Data exfiltration\n* Local privilege escalation (depending on runtime context and privileges)\n* Modification or destruction of files accessible to the user running the CLI\n\nThe vulnerability affects only scenarios where:\n\n* The user invokes `cyclonedx-npm` with `--workspace \u003cvalue\u003e`, and\n* The vulnerable execution path is reached on **Windows**.\n\n## Exploitation Conditions (High-Level)\n\nExploitation requires the attacker to supply or influence the `--workspace` value passed to the CLI.  \nIf the tool falls back to the vulnerable shell execution path on **Windows**, specially crafted workspace identifiers can cause unintended command execution.  \nNo exploit code is included here to avoid providing weaponizable examples.\n\n## Root Cause\n\nThe CLI fallback execution path on **Windows** constructed a shell command using untrusted input from the `--workspace` option.  \nBecause the fallback code path does not sanitize or escape the workspace value, special shell metacharacters (e.g., `\u003e`, `\u0026`, `|`) are interpreted by the shell, enabling command injection.\n\n## Fix\n\nThe vulnerability was resolved in [PR #1489], which ensures workspace values are handled safely and are no longer passed to a vulnerable shell execution path.\n\nThe fix is included in `@cyclonedx/cyclonedx-npm` version [6.0.0][v6.0.0].\n\n## Remediation\n\n* Upgrade to version [6.0.0][v6.0.0] or later, which contains the complete fix.\n* 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.\n* Avoid passing untrusted or user-controlled values to the `--workspace` option.\n* If immediate upgrade is not possible, prioritize mitigation on **Windows systems**, where exploitability exists.","status":"published","published":"2026-09-17T14:50:40Z","modified":"2026-09-17T14:50:42Z","cvss":[{"version":"4.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","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:41:17.136201Z"}],"nvd":[{"id":"CVE-2026-71538","description":"@cyclonedx/cyclonedx-npm creates CycloneDX Software Bill of Materials from npm projects. Prior to version 6.0.0, the Windows fallback path in src/npmRunner.ts, used when npm_execpath does not provide the npm CLI path, can construct a shell command containing an untrusted value from the --workspace option. When an attacker can influence that option and the fallback npm execution path is reached, shell metacharacters in the workspace value can execute arbitrary operating-system commands with the privileges of the user running the CLI, allowing data access, file modification, or service disruption. This issue is fixed in version 6.0.0.","status":"published","published":"2026-09-17T15:16:51.1Z","modified":"2026-09-30T17:51:36.337Z","cvss":[{"version":"4.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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high","assessor":"secondary"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:12:49.013904Z"}],"osv":[{"id":"CVE-2026-71538","title":"@cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument on Windows","description":"@cyclonedx/cyclonedx-npm creates CycloneDX Software Bill of Materials from npm projects. Prior to version 6.0.0, the Windows fallback path in src/npmRunner.ts, used when npm_execpath does not provide the npm CLI path, can construct a shell command containing an untrusted value from the --workspace option. When an attacker can influence that option and the fallback npm execution path is reached, shell metacharacters in the workspace value can execute arbitrary operating-system commands with the privileges of the user running the CLI, allowing data access, file modification, or service disruption. This issue is fixed in version 6.0.0.","status":"published","published":"2026-09-17T14:35:39.144Z","modified":"2026-10-28T02:30:24.982047961Z","cvss":[{"version":"4.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","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:45:15.164658Z"},{"id":"GHSA-q69g-4hcv-6jg4","title":"@cyclonedx/cyclonedx-npm: Shell Injection via Unsanitized --workspace Argument on Windows","description":"## Summary\n\nA **Windows-specific** command injection vulnerability exists in `@cyclonedx/cyclonedx-npm` when the CLI is invoked with the `--workspace \u003cvalue\u003e` option.  \nUser-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.  \n\nThe vulnerability was fixed in version [6.0.0][v6.0.0].\n\n## Vulnerability Details\n\nWhen `cyclonedx-npm` is executed with the `--workspace` option, the provided argument is incorporated into an internal command execution flow.  \nOn **Windows systems**, this path can interpret untrusted `--workspace` input as shell syntax if not safely handled.\n\nAs 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.\n\n## Impact\n\nAn attacker who can influence the value passed to `--workspace` can execute arbitrary OS commands **on Windows hosts**.  \nThis may lead to:\n\n* Arbitrary command execution\n* Data exfiltration\n* Local privilege escalation (depending on runtime context and privileges)\n* Modification or destruction of files accessible to the user running the CLI\n\nThe vulnerability affects only scenarios where:\n\n* The user invokes `cyclonedx-npm` with `--workspace \u003cvalue\u003e`, and\n* The vulnerable execution path is reached on **Windows**.\n\n## Exploitation Conditions (High-Level)\n\nExploitation requires the attacker to supply or influence the `--workspace` value passed to the CLI.  \nIf the tool falls back to the vulnerable shell execution path on **Windows**, specially crafted workspace identifiers can cause unintended command execution.  \nNo exploit code is included here to avoid providing weaponizable examples.\n\n## Root Cause\n\nThe CLI fallback execution path on **Windows** constructed a shell command using untrusted input from the `--workspace` option.  \nBecause the fallback code path does not sanitize or escape the workspace value, special shell metacharacters (e.g., `\u003e`, `\u0026`, `|`) are interpreted by the shell, enabling command injection.\n\n## Fix\n\nThe vulnerability was resolved in [PR #1489], which ensures workspace values are handled safely and are no longer passed to a vulnerable shell execution path.\n\nThe fix is included in `@cyclonedx/cyclonedx-npm` version [6.0.0][v6.0.0].\n\n## Remediation\n\n* Upgrade to version [6.0.0][v6.0.0] or later, which contains the complete fix.\n* 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.\n* Avoid passing untrusted or user-controlled values to the `--workspace` option.\n* If immediate upgrade is not possible, prioritize mitigation on **Windows systems**, where exploitability exists.","status":"published","published":"2026-09-17T14:50:40Z","modified":"2026-09-17T15:00:05.899785431Z","cvss":[{"version":"4.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","level":"high"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:46:54.055966Z"}]}}
