GHSA-5vwr-qchf-q4pf: @cyclonedx/cdxgen: Maven project scanning may allow shell command injection through repository-controlled module paths
A command injection vulnerability exists in the Maven scanning flow of cdxgen versions prior to 12.4.3. The vulnerability arises because some Maven commands were executed with shell: true, allowing repository-controlled directory names containing shell metacharacters to be interpreted by the shell. This could enable an attacker controlling a scanned Maven project repository to execute arbitrary commands in the cdxgen process context. The issue affects both CLI and server modes and is patched in version 12.4.3.
AI Analysis
Technical Summary
cdxgen before version 12.4.3 contains a command injection vulnerability in its Maven scanning functionality. When scanning an attacker-controlled Maven project, repository-controlled paths could be injected into Maven command invocations that used shell: true on POSIX platforms. This allowed shell metacharacters in directory names to be interpreted by the shell, potentially enabling command execution within the cdxgen process. The vulnerability affects both CLI and server modes, specifically the POST /sbom endpoint in server mode. The patch in 12.4.3 mitigates this by removing unconditional shell execution, blocking shell: true invocations with unsafe arguments, and adding other hardening measures. Residual risks remain for nested paths interpreted by external build tools after cdxgen launches them, so sandboxing untrusted scans is recommended.
Potential Impact
An attacker who controls a scanned Maven project repository can exploit this vulnerability to execute arbitrary shell commands in the context of the cdxgen process. This could lead to unauthorized code execution during scanning operations. The vulnerability affects both CLI and server modes of cdxgen. However, exploitation requires control over the scanned repository paths and the ability to trigger scans. There are no known exploits in the wild as of the published date.
Mitigation Recommendations
A fix is available in cdxgen version 12.4.3 and later, which hardens command invocation by removing unconditional shell execution and blocking unsafe shell arguments. The recommended remediation is to upgrade to version 12.4.3 or later. If immediate upgrade is not possible, apply mitigations such as not running cdxgen server mode on untrusted networks, restricting access to the POST /sbom endpoint, avoiding scanning untrusted Maven repositories, running cdxgen in sandboxed or containerized environments, removing sensitive environment variables, using least-privilege filesystem mounts, and restricting outbound network access. Use cdxgen secure/dry-run modes and configure host and command allowlists to reduce exposure. These mitigations reduce but do not fully eliminate risk in affected versions.
GHSA-5vwr-qchf-q4pf: @cyclonedx/cdxgen: Maven project scanning may allow shell command injection through repository-controlled module paths
Description
A command injection vulnerability exists in the Maven scanning flow of cdxgen versions prior to 12.4.3. The vulnerability arises because some Maven commands were executed with shell: true, allowing repository-controlled directory names containing shell metacharacters to be interpreted by the shell. This could enable an attacker controlling a scanned Maven project repository to execute arbitrary commands in the cdxgen process context. The issue affects both CLI and server modes and is patched in version 12.4.3.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
cdxgen before version 12.4.3 contains a command injection vulnerability in its Maven scanning functionality. When scanning an attacker-controlled Maven project, repository-controlled paths could be injected into Maven command invocations that used shell: true on POSIX platforms. This allowed shell metacharacters in directory names to be interpreted by the shell, potentially enabling command execution within the cdxgen process. The vulnerability affects both CLI and server modes, specifically the POST /sbom endpoint in server mode. The patch in 12.4.3 mitigates this by removing unconditional shell execution, blocking shell: true invocations with unsafe arguments, and adding other hardening measures. Residual risks remain for nested paths interpreted by external build tools after cdxgen launches them, so sandboxing untrusted scans is recommended.
Potential Impact
An attacker who controls a scanned Maven project repository can exploit this vulnerability to execute arbitrary shell commands in the context of the cdxgen process. This could lead to unauthorized code execution during scanning operations. The vulnerability affects both CLI and server modes of cdxgen. However, exploitation requires control over the scanned repository paths and the ability to trigger scans. There are no known exploits in the wild as of the published date.
Mitigation Recommendations
A fix is available in cdxgen version 12.4.3 and later, which hardens command invocation by removing unconditional shell execution and blocking unsafe shell arguments. The recommended remediation is to upgrade to version 12.4.3 or later. If immediate upgrade is not possible, apply mitigations such as not running cdxgen server mode on untrusted networks, restricting access to the POST /sbom endpoint, avoiding scanning untrusted Maven repositories, running cdxgen in sandboxed or containerized environments, removing sensitive environment variables, using least-privilege filesystem mounts, and restricting outbound network access. Use cdxgen secure/dry-run modes and configure host and command allowlists to reduce exposure. These mitigations reduce but do not fully eliminate risk in affected versions.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-5vwr-qchf-q4pf
- Osv Schema Version
- 1.4.0
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6a3ef76e27e9c79719fee9dc
Added to database: 06/26/2026, 22:04:30 UTC
Last enriched: 06/26/2026, 22:09:50 UTC
Last updated: 06/26/2026, 22:09:50 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.