Registry, API and forge credentials are sent to hosts that scanned content or project files choose
Description
cdxgen attaches the operator's credentials to outgoing requests based on a host name or an environment variable, while a scanned project, a project configuration file, a commit or an OCI referrer descriptor decides where the request goes. The author of such content can have a Docker registry login, a Dependency-Track API key, a TEA token, a gem server key, an npm registry login or a forge token sent to a host they choose.
Details
Registry referrer descriptors
When cdxgen fetches an SBOM attached to a container image, a referrer descriptor that carries a reference field decides which host receives the next manifest request, and that request carries the credential cdxgen obtained for the image's own registry. A user who can push tags or an image index to a repository on a registry can therefore collect the registry login of anyone who fetches that image's attached SBOM with cdx-validate -i, cdx-verify -i or cdx-audit --bom ... --direct-bom-audit.
getManifestImageRef() in lib/managers/oci.js returns the descriptor's reference verbatim. The loop in getBomWithOras() runs it through parseImageRef() and calls fetchManifest() on the host it names, passing the token obtained for the registry of the image the operator named. Nothing compares the two hosts. If the planted index keeps the genuine SBOM descriptor next to the hostile one, the command still succeeds and cdx-verify still reports a valid signature, because the request goes out before any signature check.
On registries that use bearer tokens, only a pull token for the repository the attacker can already push to leaks, or an anonymous token when the token endpoint is on another host. On registries that accept basic authentication, the leaked value is the Basic credential from the Docker configuration or DOCKER_AUTH.
Credentials and the host that receives them
cdxgen attaches the operator's credentials to outgoing requests based on a host name or on an environment variable, while a scanned project, a project configuration file or a commit decides where the request goes. The author of a repository, compose file, lock file or commit can have a Docker registry login, a Dependency-Track API key, a TEA token, a gem server API key, an npm registry login or a forge token sent to a host they choose, or to a place where they can read it.
The credential and the way the destination is chosen differ per case:
- DOCKER_AUTH.
getDockerCreds()inlib/managers/oci.jsreturnsDOCKER_AUTHfor any registry when no stored login matches. The container-risk rules CTR-009 and CTR-010 rebuild an image reference from the scanned content and ask that registry for an SBOM, so a compose file, Dockerfile, Kubernetes manifest or BOM can name a registry that receives the login. - Docker Hub login and the allowlist.
getImage()inlib/managers/docker.jsretries a failed pull ofdocker.io/<host>/<name>as<host>/<name>after the allowlist approved the first form, and the retry carries the Docker Hub login inX-Registry-Auth. - Dependency-Track key and TEA token from
.cdxgen.json.sanitizeProjectConfig()inlib/core/projectConfig.jslet a committed.cdxgen.jsonsetserver-url,tea-fetchandtea-publishwhile the key or token came from the operator, so the credential went to the repository's host. - Server mode.
validateRequestOptions()inlib/server/server.jsrefused a client-chosenserverUrlwith the operator's API key only when the origin differed, so another path on the same origin received the key. - npm registry login.
registryLookupForPurl()inlib/inventory/source.jsassumed that the registry ends in a slash. With a host-onlyNPM_URLthat carries a login, a scoped package name becomes the host of the request and the login goes to it.parseDenoLock()inlib/ecosystems/denoutils.jslet a project.npmrcoverrideNPM_URLeven in secure mode. - Gem server key.
getRubyGemsMetadata()inlib/ecosystems/rubyutils.jsfalls back to rubygems.org per endpoint while theAuthorizationheader is built once, so a partly overridden configuration sendsGEM_HOST_API_KEYto rubygems.org. - Forge token.
gitLogCommitsDetailed()inlib/inventory/envcontext.jssplitgit logoutput on a byte that a commit message may contain, so a commit could steer up to five GitHub or GitLab API requests that carryGITHUB_TOKENorGITLAB_TOKEN.parseGitHubUrl()andparseGitLabUrl()inlib/inventory/forgeEnricher.jsaccepted a host name hidden in the path of another URL, so a clone from such an origin made cdxgen query a private repository with the operator's token.
The findings in this advisory are:
| Issue | Code | First affected release |
|---|---|---|
| Secure mode: project .npmrc overrides NPM_URL in deno.lock scans | parseDenoLock() in lib/ecosystems/denoutils.js | 12.8.0 |
| forgeEnricher host check bypass leaks private PR review metrics into BOM | parseGitHubUrl() in lib/inventory/forgeEnricher.js | 12.7.1 |
| Predictive audit leaks NPM_URL credentials to a host named by an npm scope | registryLookupForPurl() in lib/inventory/source.js | not stated (no match found in 12.x) |
| Registry credential leak to any host named in OCI referrer descriptors | getManifestImageRef() in lib/managers/oci.js | 12.7.0 |
| CDXGEN_ALLOWED_HOSTS bypass: pull retry drops docker.io but keeps Hub login | getImage() in lib/managers/docker.js | 13.5.0 (12.x: 12.8.7) |
| BOM audit leaks DOCKER_AUTH to any registry named by scanned projects | getDockerCreds() in lib/managers/oci.js | 12.7.0 |
| Private gem server API key leaks to rubygems.org for multi-platform gems | getRubyGemsMetadata() in lib/ecosystems/rubyutils.js | 12.8.3 |
| Commits with 0x1e forge git log records and steer GITHUB_TOKEN API requests | gitLogCommitsDetailed() in lib/inventory/envcontext.js | 12.7.1 |
| Operator's API key and TEA token leak to hosts set in repo's .cdxgen.json | sanitizeProjectConfig() in lib/core/projectConfig.js | 9.8.10 |
| Server mode leaks operator's API key if serverUrl differs only in path | validateRequestOptions() in lib/server/server.js | 9.8.10 |
Impact
Disclosure of the operator's credentials, or of data read with them, to the author of scanned content. Each route needs the operator to run a specific command (a BOM audit, cdx-validate -i, a deep scan, --tea-fetch) or a server with a credential set. A leaked credential gives the recipient the access that credential grants on another system, which the vector scores as a subsequent-system impact. With a basic registry credential this can be everything the account reaches.
Patches
Fixed in @cdxgen/cdxgen 13.9.0 (cdxgen/cdxgen#4880). Versions 13.0.0 through 13.8.0 of @cdxgen/cdxgen are affected. The 12.x line, published as @cyclonedx/cdxgen, is also affected by some of the issues above from 9.8.10 through 12.9.2, and no 12.x release contains the fix. Users of 12.x should move to @cdxgen/cdxgen 13.9.0 or apply the workarounds below. File paths in this advisory refer to the 13.x source tree; in 12.x most of the same functions are under lib/helpers/ or in lib/cli/index.js.
Known limits of the fix. S1S6CK7F was fixed in two steps: the TEA half is in 13.8.0 (commit 32cd80fd8) and the Dependency-Track half in 13.9.0. DOCKER_AUTH still defaults to docker.io and is sent only to the registry named by DOCKER_SERVER_ADDRESS. A referrer descriptor is accepted only when it is a digest reference in the same repository as the image.
Workarounds
- Use a registry login limited to read access on the repositories that the workflow needs, and avoid
DOCKER_AUTHwith a shared account. - Verify attached SBOMs only for images from registries and repositories that you control, or with
CDXGEN_ALLOWED_HOSTSrestricted to the registry host in secure mode. - Give cdxgen credentials that can read only what the scan needs, and unset
DOCKER_AUTH,GEM_HOST_API_KEY,GITHUB_TOKENandNPM_URLcredentials for scans of untrusted content. - Run scans of untrusted content in secure mode with
CDXGEN_ALLOWED_HOSTSset, and review a.cdxgen.jsonin a tree before you scan inside it. - In server mode, do not let clients choose
serverUrl.
Credit
These issues were found by Anthropic's OSS Scanner (scan cdxgen-20261117-013) and reported as ANT-2026-0RATASDL, ANT-2026-5WY66LEN, ANT-2026-B9DTNE02, ANT-2026-DQDYCVXP, ANT-2026-GE7TK2CI, ANT-2026-GQVD3JVU, ANT-2026-GSJ0J4OE, ANT-2026-L42RWFS3, ANT-2026-S1S6CK7F, ANT-2026-YKRA3Y9F, and were fixed by AI agents working for the cdxgen maintainers.