Skip to content

Conversation

@DmitriyLewen
Copy link
Contributor

Description

This PR fixes a panic that occurs when processing SBOM files that don't have a root component. The issue was in the CycloneDX marshaler where it would attempt to marshal a nil metadata.component without proper validation.

Related issues

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@DmitriyLewen DmitriyLewen self-assigned this Oct 1, 2025
@DmitriyLewen DmitriyLewen changed the title fix(sbom): Don’t panic on SBOM format if scanned CycloneDX file has empty metadata fix(sbom): don’t panic on SBOM format if scanned CycloneDX file has empty metadata Oct 1, 2025
@DmitriyLewen DmitriyLewen marked this pull request as ready for review October 2, 2025 05:05
@DmitriyLewen DmitriyLewen requested a review from knqyf263 as a code owner October 2, 2025 05:05
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.

bug(cyclonedx): Trivy panics when scanning an SBOM in CycloneDX format if the file has an empty metadata component.

1 participant