Skip to main content
Menu
Advisories

tracebom trusts library paths reported by the traced program after the sandbox exits

GHSA-5QMG-32JG-748JPublished Updated GitHub

Description

tracebom runs an untrusted command inside the @cdxgen/safer-exec sandbox and then, in the unsandboxed tracebom process, works on the library paths that the trace reported. The traced program controls those paths, so it can affect what tracebom does on the host after the sandbox has exited: it can add an option to the rpm command that tracebom runs, make tracebom hash host files that the sandbox hid from it, and make tracebom write an empty BOM and exit 0.

Details

  • Option injection into package queries. buildDynamicComponents() in lib/inventory/dynamic.js passes every lib-load path to resolvePackageForFile(), which rejects only an empty path. _resolveLinux() in lib/inventory/osPackageResolver.js then runs dpkg-query -S, apk info -W and rpm -qf --qf <format> with the path as the last argument, without -- and without checking that the path is absolute. A library that the traced program loads by a relative path whose first directory name starts with -- reaches rpm as an option. rpm documents options that expand macros, and macro expansion can run shell commands. This was shown with an argument-logging stand-in for rpm; a real rpm was not run. The operator must start tracebom from the traced command's directory, which is the first documented form. On hosts with only dpkg-query or apk, no harmful option was identified.
  • Hashing host files. The same function calls checksumFile("sha256", path) for every reported path without checking that it is still a regular file under a directory the sandbox exposed. A program can load its own library from the writable project directory and then replace it with a symbolic link, so the BOM records the SHA-256 of a host file such as ~/.aws/credentials, and the presence of the component shows that the file exists. The same path lets the program keep tracebom running after --timeout.
  • Suppressing the result. executeAndTrace() in lib/inventory/traceRunner.js discards the libraries and sandbox counts already recorded when the traced program writes more than 512 MiB to its output. tracebom then writes a BOM with no components and exits 0.

Impact

tracebom exists to run programs that are not trusted (see docs/THREAT_MODEL.md, T7.1). The author of such a program can get shell commands run outside the sandbox with the operator's privileges on hosts that have rpm on PATH, including cdxgen's own AlmaLinux-based CI image. The program can also learn digests and existence of files the sandbox hides, which allows offline guessing of short or structured secrets, and it can hide its own inventory.

Patches

Fixed in @cdxgen/cdxgen 13.8.0. Versions 13.0.0 through 13.7.0 of @cdxgen/cdxgen are affected. The 12.x line, published as @cyclonedx/cdxgen, is also affected from 12.6.0 through 12.9.1, and no 12.x release contains the fix. Users of 12.x should move to @cdxgen/cdxgen 13.8.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.

Workarounds

  • Start tracebom with a working directory other than the traced program's directory, on a host without rpm.
  • Treat a tracebom BOM with no components as a failed run.
  • Run tracebom itself inside a disposable VM for programs that are not trusted.

Credit

These issues were found by Anthropic's OSS Scanner (scan cdxgen-20261108-009) and reported as ANT-2026-N7G3GT2P, ANT-2026-0LHS29DZ, ANT-2026-BSPAAN90.

References

Affected versions

References

GitHub · cdxgen/cdxgen