Skip to main content
Menu
Advisories

Denial of service from server requests, git hosts, registries, TEA servers, remote documents and crafted BOMs

GHSA-RWJH-MQFM-9QXRPublished Updated GitHub

Description

A client of cdxgen --server, a git host, a package registry, a TEA server or a remote document can make cdxgen use unbounded CPU time, memory, disk or waiting time, and a crafted BOM of a few kilobytes does the same to cdx-verify, cdx-convert, cdx-validate, cdx-audit and the SPDX export. Many server cases need nothing but one unauthenticated request; the others are triggered by a scan of a project that names the remote resource, by a project configuration file in the scanned tree, or by an operator who opens a BOM from a supplier.

Details

Server requests and remote content

A client of cdxgen --server, a git host, a package registry, a TEA server or a remote document can make cdxgen use unbounded CPU time, memory, disk or waiting time. Many of the cases need nothing but one unauthenticated request to the server; the others are triggered by a scan of a project that names the remote resource, or by a project configuration file in the scanned tree.

The causes fall into four groups. Server request options are bounded too late or not at all: a long filter or only list, repeated standards, repeated type and path lists, brace ranges and repeated ** in exclude patterns, comma-separated exclude lists, and a config file with a long host-scope type filter. Remote services are trusted to answer promptly and to answer small: a git host that sends nothing for twenty minutes blocks the event loop, a registry answer can be a decompression bomb or ask for a very long Retry-After, a TEA server can send long version strings and a very large evidence set, and a remote HTML or Terraform registry document can drive quadratic parsing, loops or retained memory. Directory walks follow symbolic loops, and the server process exits when a scanned project's .npmrc sets a blocked key. A git checkout made by the audit tool has no size bound.

Crafted BOMs in the cdx tools

A BOM, a CycloneDX 2.0 document, an embedded SPDX file or a signature object of a few kilobytes makes the BOM tools of cdxgen use CPU time or memory that grows with the square, the cube or the exponent of its size. Examples are a long RSA exponent or an explicit-curve EC key in a JSON signature, deep nesting that makes the uniqueness check of the validator quadratic, references that the CycloneDX 2.0 reader expands exponentially, a long bom-ref repeated in an SPDX namespace or in the 2.0 renderer, and rule evaluation that rescans the BOM for every component.

The input is a BOM that an operator verifies, converts, validates or audits, for example one received from a supplier, so the attack needs an operator to open the file. The table lists the code and first affected release of each case.

The findings in this advisory are:

IssueCodeFirst affected release
ReDoS in trailing-slash regex lets one request block cdxgen servercreateDirectDependencyLookup() in lib/ecosystems/npmVersionResolution.js12.4.0
Quadratic CPU in selectTeaEndpoint: long version re-parsed per entryselectTeaEndpoint() in lib/ecosystems/tea.js13.0.0 (no match found in 12.x)
SPDX export: unbounded namespace in every id turns a 100 kB BOM into 240 MBcreateNamespace() in lib/stages/postgen/spdxConverter.js12.3.0
decodeEntities is quadratic on bare ampersands in pkg.go.dev responsesdecodeEntities() in lib/parsers/htmlExtract.js13.0.0 (no match found in 12.x)
Symlink loops make workspace globs exponential (CLI and server DoS)getAllFilesWithIgnore() in lib/core/fs.js11.0.10
Brace ranges at 2^53 bypass the config-file pattern limit and stall scansbraceRangeSize() in lib/core/globPatterns.js13.7.0 (12.x: 12.9.1)
Decompression bomb in registry responses (httpClient, cdxrs fetch)rustFetchChunk() in lib/inventory/fetchBatch.jsnot stated (12.x: 12.8.1)
ReDoS via exclude globs: one request hangs the server until restartboundUntrustedGlobPatterns() in lib/core/globPatterns.js11.5.0
Quadratic BOM blowup: embedded SPDX dependsOn refs expanded to long purlstoCycloneDxLikeBom() in lib/inventory/spdxUtils.jsnot stated (12.x: 12.3.0)
CPU DoS in bom-audit via git show rename detection on crafted commitsgitCommitDiffAnalysis() in lib/inventory/envcontext.js12.7.1
CycloneDX 2.0 renderer repeats a long bom-ref: 400 kB BOM becomes 225 MBresolveAnnotationSubjects() in lib/inventory/cyclonedx20Render.js13.7.0 (no match found in 12.x)
Infinite loop in htmlExtract parseAttrs() on stray quote in pkg.go.dev HTMLparseAttrs() in lib/parsers/htmlExtract.js13.0.0 (no match found in 12.x)
cdx-verify CPU DoS via explicit-curve EC keys in JSS signaturescheckSignatureObject() in lib/helpers/jssSigner.js13.7.0 (no match found in 12.x)
Infinite recursion in upgradeDeprecatedAST on libtool-exception license (DoS)upgradeDeprecatedAST() in lib/inventory/spdxExpression.jsnot stated (12.x: 12.7.1)
cdx-convert: quadratic CPU from V8 hash collisions on long field pathscollectFieldPaths() in lib/stages/postgen/specVersionCompat.js13.0.0 (no match found in 12.x)
Quadratic host-scope type filter lets a 13 kB .cdxgen.yml stall cdxgensanitizeProjectConfig() in lib/core/projectConfig.js13.7.0 (12.x: 12.9.1)
Quadratic trailing-slash regex in cdx-purl Purl.parse() allows DoSvalidatePurls() in lib/validator/bomValidator.js13.0.0 (no match found in 12.x)
Quadratic DoS in cdx-verify via long RSA exponent in embedded publicKeyisSameKey() in lib/helpers/bomSigner.js13.3.0 (12.x: 12.8.5)
Quadratic time in PQC risk derivation: algorithm reclassified per keyclassifyKey() in lib/inventory/pqcMigration.js13.7.0 (no match found in 12.x)
Quadratic CPU time in Terraform license lookup stalls cdxgen servergetTerraformRegistryMetadata() in lib/ecosystems/terraformRegistry.jsnot stated (no match found in 12.x)
CycloneDX 2.0 reader expands refs exponentially: 6 kB BOM exhausts heapresolveComponentEntry() in lib/inventory/cyclonedx20ReadComponents.js13.7.0 (no match found in 12.x)
BOM validator uniqueItems check is quadratic in component nesting depthcanonicalize() in lib/validator/generated/runtime.mjs13.0.0 (12.x: 12.2.0)
Unbounded read-loss listing in cdx-convert and cdx-validate allows DoSrender() in lib/validator/reporters/json.jsnot stated (no match found in 12.x)
include-regex in a repo's .cdxgen.json makes getAllFiles quadraticgetAllFiles() in lib/core/fs.js11.5.0
Quadratic server DoS in hasAnyProjectType via type and path listshasAnyProjectType() in lib/core/env.js10.8.2
DoS via TEA fetch: identity evidence merge in trimComponents is cubictrimComponents() in lib/inventory/depsUtils.js13.0.0 (no match found in 12.x)
Server mode memory leak: sweptHostDirs keeps lockfile hosts until OOMsweepHostDirOnce() in lib/inventory/fetchDiskCache.js13.4.0 (no match found in 12.x)
Comma lists bypass 128-pattern exclude limit, stalling deep .NET scansgetExcludePatterns() in lib/inventory/atomUtils.js13.7.0 (12.x: 12.9.1)
cdx-audit OOM from quadratic property copying in registry enrichmentenrichInputBomsWithRegistryMetadata() in lib/audit/targets.js12.3.1
Unbounded checkout in cdx-audit lets a 2 kB git bomb fill the diskcloneRepositoryToDir() in lib/audit/index.js12.3.0
Server mode: git clone from a silent host blocks the event loop for 20 minhardenedGitCommand() in lib/inventory/source.js7.0.0
Server exits when a scanned project has a blocklisted .npmrc settingcreateNodejsBom() in lib/cli/jsBom.js12.1.5
Quadratic bom-ref dedupe in CycloneDX 2.0 renderer blocks the serverdedupeRefIds() in lib/inventory/cyclonedx20RenderRefIds.js13.7.0 (no match found in 12.x)
Quadratic CPU in BOM audit rule evaluation; 5 s timeout never firesdata/rules/ci-permissions.yaml12.3.1 (no match found in 12.x)
Unbounded filter list makes filterBom block the server for a minutefilterBom() in lib/stages/postgen/postgen.js9.8.10
Terraform registry prefetch holds all docs at once, OOMs cdxgen servergetTerraformRegistryMetadata() in lib/ecosystems/terraformRegistry.js13.4.0 (no match found in 12.x)
Unvalidated OpenTofu license id copied to every Terraform submodule (DoS)getTerraformRegistryMetadata() in lib/ecosystems/terraformRegistry.jsnot stated (no match found in 12.x)
Quadratic-time DoS in CycloneDX 2.0 reader (placeDefinition)placeDefinition() in lib/inventory/cyclonedx20Read.js13.7.0 (no match found in 12.x)
Server DoS: exclude patterns with repeated **/.. bypass the glob boundboundUntrustedGlobPatterns() in lib/core/globPatterns.js9.9.3
Uncapped Retry-After sleep in fetchBatch lets one scan hang the serverissueWithRetries() in lib/inventory/fetchBatch.js13.0.0 (no match found in 12.x)
Server mode crashes with heap OOM on repeated standards in one requestapplyStandards() in lib/stages/postgen/postgen.jsnot stated (no match found in 12.x)

Impact

Hours of CPU time or exhausted memory for one scan of crafted content, which fails or hangs a CI job. The HTTP server runs parsers on the event loop, so one such scan can leave cdxgen --server unresponsive to every client, /health included, until it ends, and CDXGEN_SERVER_TIMEOUT_MS does not interrupt synchronous work. A heap exhaustion ends the process. The server cases are scored with no user interaction and an attack requirement, because server mode is not the default way to run cdxgen; the cases that need a scanned project, a remote answer or a supplied BOM need an operator to start the run.

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 7.0.0 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. The decompression bound is in the JavaScript client only; the cdxrs helper has its own issues, tracked as cdxgen/cdxgen-plugins-bin#217 and cdxgen/cdxgen-plugins-bin#218. Git checkouts are limited to 1 GiB and 200000 entries and a git remote times out after five minutes, by default in server mode only; the command line keeps the build-tool timeout. Server requests accept at most 128 filter or only terms and 1024 types, and a config exclude such as test,tests counts as two of the 128 patterns. Retry-After sleeps are capped at one hour. The purl validator refuses purls with more than 64 consecutive slashes, which works around a quadratic pattern in cdx-purl (IIRQNWWD); the real fix belongs in cdx-purl (cdxgen/cdx-purl#16). The bom-audit rules directory is now an operator-only option, so a JSONata expression that runs for a long time (UNDZINR5) can no longer come from the scanned tree.

Workarounds

  • Restrict who can reach cdxgen --server and put it behind an authenticating proxy.
  • Use CDXGEN_ALLOWED_HOSTS and CDXGEN_SERVER_ALLOWED_HOSTS to limit the git hosts and registries the server talks to, and restart the server after an incident.
  • Run scans of untrusted content in a job with a time limit and a memory limit, and restart the server if it stops answering.
  • Apply a size limit to BOMs before you pass them to the tools.

Credit

These issues were found by Anthropic's OSS Scanner (scan cdxgen-20261117-013) and reported as ANT-2026-0EW2ILK1, ANT-2026-0NA2O2NZ, ANT-2026-1MCYGRMC, ANT-2026-2TIX2RKK, ANT-2026-3FLA0F47, ANT-2026-4BPAX45J, ANT-2026-60RU5TR5, ANT-2026-6E8IF9CG, ANT-2026-9I256SEW, ANT-2026-A6I1VCUE, ANT-2026-B24B5KN8, ANT-2026-C2IV9ZOK, ANT-2026-CBQWP5TX, ANT-2026-EODF9F6B, ANT-2026-EWBBN7HX, ANT-2026-HW4XJMJJ, ANT-2026-IIRQNWWD, ANT-2026-KVKV8BOL, ANT-2026-MD9D9PRZ, ANT-2026-MGJFPPM9, ANT-2026-MQGUBE47, ANT-2026-N9D7M1RN, ANT-2026-NBPWO3YX, ANT-2026-NOZ2OUQF, ANT-2026-NU8FMTR3, ANT-2026-P0XNDTOA, ANT-2026-R1NZYPZQ, ANT-2026-RY8TVTHD, ANT-2026-T798HB3K, ANT-2026-T84X1FRG, ANT-2026-TTCUS8LM, ANT-2026-TTYZ5HQ6, ANT-2026-UMBIEYCG, ANT-2026-UNDZINR5, ANT-2026-UTNNOY9P, ANT-2026-WIKLNI1X, ANT-2026-WSWMLNU6, ANT-2026-YMDRUJTI, ANT-2026-YOWXG6LY, ANT-2026-Z9HHP2P9, ANT-2026-Z9IZD4Z4, and were fixed by AI agents working for the cdxgen maintainers.

References

Affected versions

References

GitHub · cdxgen/cdxgen