# GHSA-367G-M2Q9-PWQH: cdx-sign and cdx-verify gaps, audit findings hidden by an embedded SBOM, and terminal escapes in output

- Database: GitHub
- Severity: CVSS 2.3 (Low)
- Published: 2026-11-19
- Modified: 2026-11-19

## Affected versions

- @cdxgen/cdxgen (npm): from 13.0.0, fixed in 13.9.0
- @cyclonedx/cdxgen (npm): from 12.2.1, through 12.9.2

## Description

### Summary

Three kinds of trust checks can be made to report a result that the input does not justify. `cdx-sign` and `cdx-verify` accept BOMs whose root signature was removed, whose existing signature is invalid, or that contain a complete nested BOM that can be lifted out. An embedded SBOM in a Python package or a TEA artifact can set `cdx:` properties on other components and so hide `--bom-audit` findings. Text from scanned files or a BOM is written to the terminal with control characters, so output can show a line the tool did not print.

### Details

#### Signing and verification

Several gaps let a person who can edit a signed BOM between pipeline stages get a countersignature or a passing verification for content that the signer never signed. In each case no key is forged: the check that should have refused the BOM is skipped, or the BOM contains a nested document that stands alone.

- **Stripped root signature.** `cdx-sign --verify-existing-with` skipped its history check when the BOM had no root signature (`signJssDocument()` in `bin/sign.js`), and `cdx-verify` with `--require-all --allow-nested-only` skipped the check that every given key signed the BOM when the root signature was removed (`verifyBomSignatures()` in `lib/helpers/bomSigner.js`).

- **Deep nesting.** `checkExistingJssSignatures()` in `bin/sign.js` countersigned a CycloneDX 2.0 BOM with an invalid existing signature when the BOM contained an object nested about 4470 levels deep.

- **Lifted members.** `signJssBom()` in `lib/helpers/jssSigner.js` signed nested annotations, inventory entries and compositions that are themselves complete BOMs, so such a member could be cut out and verified as its own file.

#### Audit results

A Python package in a scanned tree can ship an embedded SBOM (PEP 770) that lists another component's purl with a `cdx:` property such as `cdx:npm:hasInstallScript=false`. cdxgen merged those properties onto the other component, so the rules of `--bom-audit` no longer fire for it, and the secure-mode `--bom-audit` CI step can change from exit 1 to exit 0. A TEA artifact fetched with `--tea-fetch` has the same effect.

`tagSbomComponents()` in `lib/inventory/sbomDocument.js` copied the properties of components from embedded SBOMs into the scan's components, including properties in the `cdx:` namespace that cdxgen itself sets. The fix keeps `cdx:` properties of foreign SBOMs out of the merge.

#### Terminal output

Text from scanned files or from a BOM is written to the terminal by the table renderer, by configuration warnings, by validator status lines and by the console shim, without removing control characters. A crafted value can move the cursor, clear lines or hide text, so the output can show a line that the tool did not print, such as a success message.

The earlier fix of `cdx-verify` output escaped control characters in two sinks. The table renderer (`wrapCellText()` in `lib/inventory/table.js`), configuration warnings in `bin/cdxgen.js`, status lines in `lib/validator/bomValidator.js` and `print()` in `lib/core/ui.js` still passed them through. A new helper `sanitizeTerminalText()` keeps newlines, tabs and colour sequences and escapes every other control character.

The findings in this advisory are:

| Issue | Code | First affected release |
|---|---|---|
| cdx-sign chain mode countersigns invalid JSS signatures on deeply nested JSON | `checkExistingJssSignatures()` in `bin/sign.js` | 13.7.0 (no match found in 12.x) |
| cdx-sign ignores --verify-existing-with if root signature is stripped | `signJssDocument()` in `bin/sign.js` | 13.7.0 (no match found in 12.x) |
| Stripping root signature bypasses --require-all in nested-only mode | `verifyBomSignatures()` in `lib/helpers/bomSigner.js` | 13.4.0 (12.x: 12.8.6) |
| Terminal escape injection in table renderer and cdx-verify output | `wrapCellText()` in `lib/inventory/table.js` | not stated (12.x: 12.3.1) |
| PEP 770 SBOMs can hide audit findings on other packages via cdx: properties | `tagSbomComponents()` in `lib/inventory/sbomDocument.js` | 13.0.0 (no match found in 12.x) |
| cdx-sign signs nested BOMs at 2.0, so lifted copies pass cdx-verify | `signJssBom()` in `lib/helpers/jssSigner.js` | 13.7.0 (no match found in 12.x) |

### Impact

Integrity of verification and audit results: an approver's signature on altered content, a lifted nested BOM that passes `cdx-verify`, or an audit gate that reports no finding for a dependency that has one. The terminal case is display-only. No key is forged and no code runs.

### 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 12.2.1 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.
`cdx-verify --deep` prints a note when a signed inner component is present and the verdict is unchanged. `cdx-sign --mode signers|chain` refuses a BOM that lost its root signature unless `--allow-unverified-history` is given. Colour (SGR) sequences are kept in tables, so a hostile value can still colour or conceal text inside its own cell or line; a reset is appended per line and per cell border.

### Workarounds

- Verify the full chain with `cdx-verify` using every expected key and do not accept a BOM without a root signature where a root signature is expected.
- Keep unsigned intermediate BOMs in storage that other parties cannot modify.
- Do not rely on `--bom-audit` alone as the gate for untrusted dependencies, and review the Python packages that ship embedded SBOMs.
- Treat terminal output of scans of untrusted content as untrusted and prefer the JSON or SARIF reporters in automation.

### Credit

These issues were found by Anthropic's OSS Scanner (scan cdxgen-20261117-013) and reported as ANT-2026-0MSH0VVR, ANT-2026-9VH4NTAO, ANT-2026-GSRKP88P, ANT-2026-ML3SF13Y, ANT-2026-QA6KO8PG, ANT-2026-TNYBMWZE, and were fixed by AI agents working for the cdxgen maintainers.

### References

- https://github.com/cdxgen/cdxgen/blob/master/SECURITY.md
- https://github.com/cdxgen/cdxgen/blob/master/docs/THREAT_MODEL.md
- Fixed in: https://github.com/cdxgen/cdxgen/pull/4880

## References

- https://github.com/cdxgen/cdxgen/security/advisories/GHSA-367g-m2q9-pwqh

Page: https://cve.now/GHSA-367G-M2Q9-PWQH

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
