SBOM Basics: Validating CycloneDX and SPDX Files and Comparing Releases
What a software bill of materials should contain, how to check a CycloneDX or SPDX file before you ship it, and how to compare two SBOMs between releases.

SBOM Basics: Validating CycloneDX and SPDX Files and Comparing Releases
A software bill of materials, or SBOM, is a list of everything inside a piece of software: libraries, frameworks, their versions and where they came from. Since the US executive order on cybersecurity in 2021 and the EU Cyber Resilience Act, customers and regulators increasingly expect one with each release. Generating an SBOM is now easy. Making sure it is correct, and using it to understand what changed, is the part teams skip. This guide covers both.
The two formats
There are two widely used standards. CycloneDX, from OWASP and now standardised as ECMA-424, focuses on security use cases and is popular with scanners. SPDX, from the Linux Foundation and published as ISO/IEC 5962, started with licence compliance and covers files, packages and relationships. Both have JSON forms; SPDX also has a simple tag-value text format. Tools such as syft, cdxgen and Trivy can write either.
What a good SBOM contains
In 2021 the NTIA defined seven minimum elements that every SBOM should carry:
- Supplier name for each component.
- Component name.
- Version.
- A unique identifier, usually a package URL (purl) or CPE.
- Dependency relationships.
- Author of the SBOM data.
- A timestamp.
Generators reliably fill names and versions. Suppliers and dependency relationships are often missing, which makes the SBOM less useful when a vulnerability lands and you need to know who maintains a component and what pulls it in.
Structural problems to look for
An SBOM can be syntactically valid JSON and still be broken. Common faults include:
- Duplicate bom-ref values in CycloneDX or duplicate SPDXIDs, which confuse tools that build graphs.
- Dependencies or relationships that point at components that are not in the file.
- Malformed package URLs, for example missing the pkg: prefix or the type.
- Wrong or missing document fields: specVersion, serialNumber format, SPDX dataLicense (must be CC0-1.0) or documentNamespace.
- Hash entries with unknown algorithm names or non-hex values.
- Timestamps that are not ISO 8601.
Catching these before you publish saves an awkward conversation with a customer whose tooling rejects the file.
Comparing two releases
The most practical everyday use of SBOMs is the diff. Between two releases, you want to know which components were added, which were removed, which were upgraded and which, surprisingly, were downgraded. New components deserve a quick look at their maintainers and licences. Downgrades often reveal a lockfile accident. Licence changes on the same version can indicate a metadata fix or a real relicensing.
Matching components across releases works best by package URL without the version: pkg:npm/lodash in one file matches pkg:npm/lodash in the other regardless of version. Version comparison should be numeric part by part, so 4.17.9 is older than 4.17.21, and pre-release tags count as lower than the final release.
Doing it in the browser
The SBOM Viewer, Validator and Diff handles all of this without installing anything. Paste or open a CycloneDX JSON file or an SPDX JSON or tag-value file, and it validates the structure, lists errors and warnings with the JSON path, and shows a coverage bar for each NTIA minimum element. The components tab lets you search the inventory, see a licence summary and export CSV. Paste a second SBOM and the compare tab lists added, removed, upgraded, downgraded and relicensed components, with a Markdown table you can drop into release notes. Files never leave your browser.
Fitting it into your process
- Generate the SBOM in CI from the built artefact, not from the source tree, so it reflects what ships.
- Validate it in the same pipeline and fail the build on structural errors.
- Store it with the release, and diff it against the previous release as part of the review.
- Feed it into a vulnerability scanner and keep it for when the next big library vulnerability is announced.
What an SBOM is not
An SBOM is an inventory, not a verdict. It does not say whether components are vulnerable, whether licences are compatible or whether the build was tampered with. It is the foundation that those checks need. Keep it accurate and the rest becomes much easier.



