Skip to content

Fix CycloneDX result mutation and evidence merging while preserving version formatting - #625

Open
PekSec wants to merge 2 commits into
RetireJS:masterfrom
PekSec:codex/cyclonedx-compatibility
Open

PekSec wants to merge 2 commits into
RetireJS:masterfrom
PekSec:codex/cyclonedx-compatibility

Conversation

@PekSec

@PekSec PekSec commented Sep 18, 2026 •

Copy link
Copy Markdown

CycloneDX reporting mutated shared scan results while formatting versions and could discard vulnerabilities and evidence when the same component appeared more than once. This PR formats a report-local copy and merges repeated components' vulnerability ranges, occurrences, and detection evidence before deduplication.

The existing version transformation is preserved for XML 1.4 and JSON 1.4/1.6/1.7, including PURLs, component references, and identity evidence. This addresses the parser compatibility concern raised on #622 without changing consumer-facing formatting or introducing a new option. The original scan findings remain unchanged.

This is the reporter-only replacement for the relevant part of #622. CLI, extension, and build-script changes are excluded.

Validation: compatibility regressions first failed, then passed after the fix; all 68 Node tests, TypeScript checking, nonfixing ESLint, and repository validation pass. The full repository detection suite also passes. Tests cover short versions, releases, prereleases, build metadata, unchanged inputs, merged components, schema validation, and VEX/component reference consistency.

AI-assisted implementation. The retained legacy transformation pads short versions and replaces hyphens; it is not a new numeric-only version sanitizer.

Related independent replacements: CLI fixes #623 and browser extensions #624.

@eoftedal

Copy link
Copy Markdown
Member

The mutation happens inside logger.close(), which runs on scan-done after the exit code is already decided. Nothing reads the findings afterward.

@eoftedal

Copy link
Copy Markdown
Member

But I'm fine with removing the mutation

@eoftedal

Copy link
Copy Markdown
Member

Merging is blocked: Commits must have verified signatures.

@eoftedal

Copy link
Copy Markdown
Member

@copilot Move the version normalization that is now duplicated across 3 files to utils.ts and import it

@PekSec
PekSec force-pushed the codex/cyclonedx-compatibility branch from e793fb7 to f171f16 Compare September 30, 2026 12:46
@PekSec

PekSec commented Sep 30, 2026

Copy link
Copy Markdown
Author

Both commits now have verified signatures. No code changes.

@PekSec
PekSec requested a review from eoftedal October 2, 2026 10:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants