# CycloneDX cdxgen Docker registry auth substring match credential forwarding

Source: https://junglewise.ai/threats/cyclonedx-cdxgen-docker-registry-auth-substring-match-credential-ac25a7eb  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-08. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: medium · CVSS 4 · Published 2026-05-08

cdxgen is a tool used to generate software bill-of-materials (BOM) documents for container images by scanning them through Docker. A flaw in its credential handling logic causes it to forward authentication credentials for one private container registry to a different registry when the registries' hostnames have a substring match. This allows attackers who control a registry matching part of a victim's private registry hostname to steal the victim's Docker credentials.

Technologies: [CycloneDX Cdxgen](https://junglewise.ai/threats/technologies/cdxgen), [@cyclonedx/cdxgen (npm)](https://junglewise.ai/threats/technologies/cyclonedx-cdxgen). Vendors: [CycloneDX](https://junglewise.ai/threats/vendors/cyclonedx), [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Medium severity, with a CVSS score of 4, published 8 May 2026.

**Which products and versions are affected?** CycloneDX Cdxgen >=9.9.5 through 12.3.2; @cyclonedx/cdxgen (npm) SEMVER:introduced=9.9.5,fixed=12.3.3.

**Is there a fix for This vulnerability?** Yes. @cyclonedx/cdxgen (npm): upgrade to 12.3.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network.

**Am I affected?** Check whether you run CycloneDX Cdxgen or @cyclonedx/cdxgen (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @cyclonedx/cdxgen (npm): upgrade to 12.3.3 or later

  ```sh
  npm install @cyclonedx/cdxgen@12.3.3
  ```


## Technical details

cdxgen contains an origin-unsafe registry credential matching vulnerability in lib/managers/docker.js that uses substring matching instead of strict hostname comparison. When selecting Docker credentials from config.json for an image pull request, the code checks if serverAddress.includes(forRegistry), which incorrectly matches "private-registry.example.com" when requesting "registry.example.com". The matched credentials are then serialized into the X-Registry-Auth header and sent to the Docker daemon API for the wrong registry. Attack requires the victim to scan an image from a registry whose hostname is a substring of their private registry hostname; no special privileges or authentication are needed. The fix (available in v12.3.3 and PR #3964) replaces substring matching with normalizeRegistryHost and registriesMatch functions for strict hostname comparison. Affected versions: >=9.9.5 through 12.3.2.

## Affected products

- CycloneDX cdxgen >=9.9.5 through 12.3.2

## Timeline

- 2026-05-08: disclosed
- 2026-05-08: patched: Fixed in version 12.3.3 (PR #3964)

## References

- [https://github.com/cdxgen/cdxgen/security/advisories/GHSA-qhh4-458h-xwh2](https://github.com/cdxgen/cdxgen/security/advisories/GHSA-qhh4-458h-xwh2)
- [https://github.com/cdxgen/cdxgen](https://github.com/cdxgen/cdxgen)

## Related threats

- [CycloneDX cdxgen command injection in Maven scanning](https://junglewise.ai/threats/cyclonedx-cdxgen-command-injection-in-maven-scanning-9ca19763)
- [CycloneDX cdxgen code execution in build files](https://junglewise.ai/threats/cve-2024-50611-cyclonedx-cdxgen-code-execution-in-build-files)
