Scanned content makes cdxgen run project tooling, a gpg program or project code although installs are off
Description
Several paths let a scanned repository have its own tooling run, its files imported as code, or its git configuration honoured, although the operator turned installs off or asked for secure mode, or although the path never asked for installs at all. They share one impact: a program of the repository author's choosing, or an option of the author's choosing for an external tool, runs as the user who runs cdxgen. The routes are the project's build wrappers and installers, pnpx, .npmrc settings, the helper piptree.py importing repository files, option injection into go and sourcekitten, and git's gpg program and certificate fetches for a repository that arrives with its own .git directory.
Details
Project tooling
Several paths let a scanned repository have its own tooling run, or have its files imported as code, although the operator turned installs off with --no-install-deps or CDXGEN_SECURE_MODE=true, or although the path never asked for installs at all. The author of a scanned repository can use them to run a program of their choice as the user who runs cdxgen.
- cdxi. The
.createcommand inbin/repl.jscalledcreateBom()with a literalinstallDeps: true, so the project'sgradlewormvnwand the install steps of other ecosystems ran in acdxisession started in secure mode. - pnpx.
createNodejsBom()inlib/cli/jsBom.jsletpackage.jsonselectpnpxas the package manager, which runspnpm dlx, fetches a package from the registry named in the project's.npmrcand runs it. The list of package managers that get--ignore-scriptswas shorter than the list that could be selected. .npmrckeys. The.npmrcblocklist inlib/parsers/npmrc.jswas bypassed by quoting a key, and lackedglobal,prefix,proxyand related keys, so the automaticnpm installcould applynode-options, replace a global package or send a registry token to a proxy named by the project.- Unset installDeps.
createNodejsBom()andcreatePythonBom()testedoptions.installDeps !== false, so an application that calledcreateBom()without the option ranrush installandpipenv installin secure mode. - Compose images.
createContainerSpecLikeBom()inlib/cli/index.jsscanned an image name that is a link to a project directory with the caller'sinstallDepsoption dropped, so the project's build wrapper ran. - piptree.
getTreeWithPlugin()inlib/managers/piptree.jsbuiltPYTHONPATHwith an empty first entry, so a versioned Python project type ran with the scanned directory ahead of the standard library onsys.pathand executed repository files such asjson.pyinside cdxgen's own helper.
Option injection
Two code paths put strings from scanned files on the command line of an external tool without checking for a leading dash. A go.sum module name reaches go mod why, and a source file name from a committed Swift build description reaches sourcekitten. The author of a scanned project can add options of their own to those commands. The options reachable through the first route only change which files go reads, and the second route sits next to other ways in which a Swift build description already steers the same run, so the effect is small.
createGoBom() in lib/cli/nativeBom.js, with USE_GOSUM=true, runs go mod why -m -vendor <name> for every component parsed from go.sum. decodeGosumData() takes the first field of a line as the name, and the spawn has no leading-dash check and no --. The branch also runs on image scans and under --no-install-deps.
createSemanticsSlices() in lib/evinser/swiftsem.js appends each source named in a committed description.json that exists to the sourcekitten index arguments after --. Relative names resolve against the directory cdxgen started in, and @file entries are expanded by the Swift tools as response files. sanitizeSwiftModuleArgs() filtered the other arguments of the same file but not the source list. This matches a hardening gap that was public before the fix (cdxgen commit 5fc2a149e99c covered the -I @file form only).
Git configuration of the scanned repository
cdxgen runs git inside the scanned directory for release notes and for the AI provenance audit. Git then honours the configuration and the pointers that the scanned tree supplies. A tree that arrives with its own .git directory can make git start a program from the tree, a signed commit can make cdxgen's helper processes fetch a URL of the commit author's choosing, and a .git pointer file can make cdxgen read the metadata of another repository. These cases apply in secure mode too.
- gpg program.
buildReleaseNotesFromGit()runsgit logthroughhardenedGitCommand()inlib/inventory/source.js. The wrapper pinned only a few settings, so the repository's.git/configstill decidedlog.showSignatureandgpg.program, and git started the program named there to verify a signature. The command allowlist only seesgit. The tree must arrive with its.gitdirectory (an unpacked archive or CI artifact; agit clonedoes not copy.git/config), and release notes must be on. - X.509 signatures.
gitLogCommitsDetailed()inlib/inventory/envcontext.jsreads the last 20 commits with%G?, which makes git verify each signature. For an X.509 signature,gpgsmasksdirmngrto download the revocation list from a URL in the signer's certificate. The request does not go through cdxgen's HTTP client, so the host allowlist does not apply, and the author's certificates are imported into the operator's keyring. This needs the AI provenance audit andgpgsmanddirmngrinstalled. - Git pointers.
execGitCommand()inlib/inventory/envcontext.jsfollowed a.gitfile or link that points outside the scanned tree and put the metadata of the other repository into the BOM, even in secure mode.
The findings in this advisory are:
| Issue | Code | First affected release |
|---|---|---|
| .npmrc blocklist bypass via quoted keys lets npm apply node-options | createNodejsBom() in lib/cli/jsBom.js | 12.1.5 |
| Blind SSRF via gpgsm CRL fetch on X.509-signed commits, even in secure mode | GIT_HARDENING_CONFIG_ARGS() in lib/inventory/envcontext.js | not stated (no match found in 12.x) |
| .git pointer leaks another repo's git metadata into BOM, even in secure mode | execGitCommand() in lib/inventory/envcontext.js | 12.2.0 |
| packageManager pnpx runs a package from the repo's registry via pnpm dlx | createNodejsBom() in lib/cli/jsBom.js | 10.5.2 |
| cdxi .create ignores secure mode and runs the project's gradlew | action() in bin/repl.js | 11.1.3 |
| Secure mode still runs rush and pipenv install if installDeps is unset | createNodejsBom() in lib/cli/jsBom.js | 11.1.3 |
| Compose scan runs mvnw despite --no-install-deps via symlinked image name | createContainerSpecLikeBom() in lib/cli/index.js | 13.3.0 (no match found in 12.x) |
| .npmrc blocklist gaps: global packages replaced, npm token leaked to proxy | createNodejsBom() in lib/cli/jsBom.js | 10.5.2 |
| Swift evidence: sourcekitten argument injection via description.json sources | createSemanticsSlices() in lib/evinser/swiftsem.js | 13.3.0 (no match found in 12.x) |
| Release-notes git log runs the repo's gpg program, even in secure mode | hardenedGitCommand() in lib/inventory/source.js | 12.3.0 |
| Argument injection into go mod why via go.sum module names (USE_GOSUM) | createGoBom() in lib/cli/nativeBom.js | 9.8.8 |
| piptree.py imports modules from scanned repo via empty PYTHONPATH entry | getTreeWithPlugin() in lib/managers/piptree.js | 10.9.3 |
Impact
Code execution as the user running cdxgen, with its environment, from files committed to a scanned tree, in configurations that were meant to keep project code from running. Each route needs a specific project type, lock file layout, embedding or tree layout (the gpg route needs the tree to arrive with its .git directory and release notes or the AI provenance audit to be on), which the vector scores as an attack requirement. The option-injection routes only change which files go reads or add compiler options to sourcekitten, and the piptree route applies in all modes.
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.8 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. Project .npmrc keys that point npm at another proxy or certificate authority (proxy, https-proxy, cafile, ca, strict-ssl) are now overridden with a warning and the install continues; global, prefix and node-options spellings are refused. CX5NQH1A was already fixed for the symbolic-link route in 13.8.0, and the 13.9.0 change passes the caller's option to the nested scan as defence in depth. EG7G5UAS (git diff.external) was closed in 13.8.0 by commit 563133b77. In secure mode, pip never builds a local project directory (HX8QMYMN).
Workarounds
- Scan untrusted trees in a disposable container or VM that holds no credentials.
- Do not use
cdxi.createon untrusted trees. - Pass an explicit
-tthat avoids versioned Python types and JavaScript scans of untrusted projects. - Leave
USE_GOSUMunset for untrusted Go projects. - Do not run
cdxgen -t swift --evidenceon untrusted checkouts from inside them. - Scan fresh
git clonecheckouts rather than unpacked trees that carry a.gitdirectory. - Do not use
--include-release-notes,--bom-auditor theappsecprofile on trees you do not control, or run them in a disposable container withoutgpgsm. - Keep
CDXGEN_GIT_ALLOW_EXTERNAL_GITDIRunset.
Credit
These issues were found by Anthropic's OSS Scanner (scan cdxgen-20261117-013) and reported as ANT-2026-2N0UY0S8, ANT-2026-45BHIKYK, ANT-2026-4PQM17OE, ANT-2026-9HQ81IAD, ANT-2026-A38EMC7X, ANT-2026-BMMYM9YN, ANT-2026-CX5NQH1A, ANT-2026-D0MP0VE3, ANT-2026-D44OIDDZ, ANT-2026-G4GK5TAS, ANT-2026-M6PAJX5X, ANT-2026-TU4ZQC80, and were fixed by AI agents working for the cdxgen maintainers.