Skip to content

XML serialization of components with authors results in invalid CycloneDX SBOM #638

@MarcelBochtler

Description

@MarcelBochtler

When using cyclonedx-core-java to write a CycloneDX SBOM as an XML, the resulting SBOM is invalid.

Expected:

  <components>
    <component type="library" bom-ref="Maven:me.xdrop:fuzzywuzzy:1.4.0">
      <authors>
        <author>
          <name>Panayiotis P</name>
        </author>
      </authors>
    </component>
  </components>

Actual:

  <components>
    <component type="library" bom-ref="Maven:me.xdrop:fuzzywuzzy:1.4.0">
      <authors>
        <authors>
          <name>Panayiotis P</name>
        </authors>
      </authors>
    </component>
  </components>

Note the plural of authors in the nested tag.

The spec, and also the cyclonedx-cli show that the nested block should be author instead of authors.

We discovered this when generating CycloneDX reports using ORT, which uses cyclonedx-core-java.
In ORT I wrote a test to reproduce this issue: oss-review-toolkit/ort#10271.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions