Skip to main content
Menu
Advisories

Crafted container images and root filesystems stall or crash image scans

GHSA-3G3F-MWJ3-2P7PPublished Updated GitHub

Description

A crafted image archive, registry image or root filesystem makes cdxgen -t docker, -t oci or -t rootfs spend minutes to hours of CPU, or abort on heap exhaustion, from inputs as small as a few hundred bytes. Image scans run with installs off and in secure mode, so neither prevents this, and in cdxgen --server the work blocks or ends the server process.

Details

The image's own metadata and file layout drive the cost: archive index entries, the config's environment, tar entry names, directory nesting, OS release fields and package records, certificate files and runtime files. The causes are unbounded expansion of values, quadratic loops over package records and files, and backtracking regular expressions.

InputCodeFirst affected release
Duplicate index.json entries in an OCI archive (1.6 kB is enough to exhaust the heap)resolveArchiveManifest() in lib/managers/docker.js12.3.0
Replacement patterns in the image config's Env (910 bytes exhaust the heap)extractPathEnv() in lib/core/env.js11.2.2
Tar entry names made of long runs of slashesstripAbsolutePath() in lib/managers/docker.js11.0.8
Nested site-packages, .cargo or .composer directoriesgetPkgPathList() in lib/managers/docker.js3.0.0
A long VERSION_ID in etc/os-release, copied into every OS package purlgetOSPackages() in lib/managers/binary.js9.6.1
A crafted maintainer line in an OS package record (regular expression)parseOrganizationalContact() in lib/managers/binary.js12.4.0
One init script listed by many packages, parsed once per packagecreateOSPackageServices() in lib/managers/binary.js12.4.0
Many package records whose service properties are deduplicated by rescanningdedupeServices() in lib/managers/binary.js12.4.0
Thousands of small PEM files labelled TRUSTED CERTIFICATEapplyTrustMaterialEnhancements() in lib/managers/binary.js13.5.0 (not in 12.x)
Deep directory names that repeat lib/phpcollectNativeExtensions() in lib/inventory/osPackageResolver.js13.6.0 (not in 12.x)
A crafted deps.json in a .NET runtime directory (regular expression)runtimePackFromDepsJson() in lib/inventory/dotnetRuntime.js13.6.0 (not in 12.x)
Many Ruby-named files beside large rbconfig.rb files in one install prefixreadRubyBuildVersion() in lib/inventory/rubyBuildInfo.js13.6.0 (not in 12.x)

Impact

Loss of availability for pipelines and services that scan images built by others, including golden-image and registry scanning jobs and cdxgen --server. No data is disclosed or modified.

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 by some of the issues above from 3.0.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. The first affected release of each issue is in the table above.

Workarounds

  • Scan images from untrusted sources with time and memory limits, in a process that does no other work.
  • Run cdxgen --server under a supervisor that restarts it, behind a reverse proxy with authentication.

Credit

These issues were found by Anthropic's OSS Scanner (scan cdxgen-20261108-009) and reported as ANT-2026-KZ16AIOE, ANT-2026-4LACUDDU, ANT-2026-1TRG52HT, ANT-2026-BGM30I0P, ANT-2026-C5B96LS9, ANT-2026-E49A5S56, ANT-2026-YNSZZ5CY, ANT-2026-19GYYXE3, ANT-2026-PW2SZXIT, ANT-2026-BSOAS4V4, ANT-2026-Z4WEVOW0, ANT-2026-NSSVPQ0A.

References

Affected versions

References

GitHub · cdxgen/cdxgen