Skip to content

Validate uploaded BOMs against CycloneDX schema #3218

Closed

Description

@nscuro

Current Behavior

Uploaded BOMs are currently not validated against the CycloneDX schema.

Users who upload (unknowingly) invalid BOMs only get to know about that fact when inspecting the logs of the API server. Further, error logs from the BOM parser can be hard to understand. Instead of spewing out gibberish error messages, it should be stated clearly if the BOM is invalid to begin with.

Proposed Behavior

Validate uploaded BOMs against the CycloneDX schema synchronously, as an additional step of handling upload requests.

Users and clients should know immediately if the uploaded file is invalid and has no chance of being ingested.

This is already implemented in Hyades and merely needs backporting: https://github.com/DependencyTrack/hyades-apiserver/blob/ef39532e0b98962b7fc290902cb33edba52ade51/src/main/java/org/dependencytrack/resources/v1/BomResource.java#L438-L466

Note
There may be tools out there that generate BOMs that are valid JSON / XML, but not entirely schema conform. As a consequence, there will be users who will have to adjust / fix their tooling first. Dependency-Track should have an "escape latch" to disable validation for those users. However, validation should default to on.

Checklist

Activity

  1. added
    enhancement
    on Nov 21, 2023
  2. added this to the 4.11 milestone on Nov 21, 2023
  3. melba-lopez commented on Feb 3, 2024

    @melba-lopez

    +1 on this.

    • Not all DT Users will have admin privileges or the knowledge about cyclonedx cli tool for further validation.
    • A general user should be able to get a toast notification that the BOM does not meet specification (and that is why the bom failed to upload).
    • Additionally, it would be helpful for non-admin users to be able to navigate within DT to upload the BOM to a specification validator, so that they may see where the problem resides and/or get output with this data.

    If a 3rd party vendor, supplier, etc. provides a malformed SBOM, giving users the basic data of why and where the problem is would reduce time to remediation/analysis.

  4. jhlmco commented on Feb 3, 2024

    @jhlmco

    There's plenty of tools to handle sbom validation. Perhaps just a response from dependency track saying "Malformed CycloneDX SBOM". I wouldn't duplicate what other tooling is doing.

  5. added 2 commits that reference this issue on Mar 3, 2024
    5dd3526
    c79c560
  6. self-assigned this
    on Mar 3, 2024
  7. added 6 commits that reference this issue on Mar 4, 2024
    1f27b23
    a915d15
    823bbc0
    fc7cb33
    82ffe5e
    bd28ebe
  8. added a commit that references this issue on Mar 15, 2024
    e8549de
  9. github-actions commented on Apr 10, 2024

    @github-actions
    Contributor

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  10. locked as resolved and limited conversation to collaborators on Apr 10, 2024
  11. added a commit that references this issue on Jun 17, 2026
    7e9875f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions