A software bill of materials (SBOM) lists the components inside an application: libraries, versions, package identifiers, licences and how they relate. Customers ask for them, regulators mention them, and vulnerability tools consume them. Before you generate your first one you face a choice between two SBOM formats that dominate the field. This article compares CycloneDX vs SPDX on the points that matter in practice and shows how to produce and scan both with open-source tools.
The short answer
Both are open, well-supported standards, and most mature tools read and write both. If your main goal is security and vulnerability management, CycloneDX is often the more direct fit. If your main goal is licence compliance, or a customer or regulator names ISO/IEC 5962, SPDX is the natural choice. Many teams generate both from the same build, because it costs almost nothing.
Where each format comes from
SPDX (Software Package Data Exchange) started at the Linux Foundation in 2010 with a focus on licence compliance. SPDX 2.2.1 was published as the international standard ISO/IEC 5962:2021. SPDX 3.0 restructured the specification into a core model plus profiles: Core, Software, Security, Licensing, Dataset, AI, Build and Lite, among others (SPDX 3.0.1 spec).
CycloneDX began in the OWASP community in 2017 with a security focus. It is now also an Ecma standard, ECMA-424, developed with Ecma's TC54, and the latest specification is version 1.7. Beyond software, it can describe SaaS services (SaaSBOM), hardware (HBOM), cryptographic assets and machine learning models.
CycloneDX vs SPDX at a glance
| CycloneDX | SPDX | |
|---|---|---|
| Origin | OWASP, security focus | Linux Foundation, licence focus |
| Formal standard | ECMA-424 | ISO/IEC 5962:2021 (SPDX 2.2.1) |
| Current spec | 1.7 | 3.0.x (2.3 still widely used) |
| Serializations | JSON, XML, Protocol Buffers | 2.x: tag-value, JSON, YAML, RDF, spreadsheet; 3.x: JSON-LD |
| Vulnerability data | Built-in vulnerabilities and VEX | External references in 2.x; Security profile in 3.x |
| Licence detail | SPDX licence IDs and expressions | Very detailed: declared vs concluded licences, file-level data |
| Beyond software | Services, hardware, crypto, ML | Datasets, AI, build profiles in 3.x |
Data model differences that matter
Component identity
Both formats identify packages with Package URLs (purl), such as pkg:npm/lodash@4.17.21, and can carry CPEs and hashes. Purl is what vulnerability matchers rely on most, so check that your generator fills it in either format.
Relationships
SPDX has a rich set of typed relationships between elements (contains, depends on, generated from, and many more). CycloneDX uses a dependency graph plus nested components, which is simpler to read but less expressive. For "which libraries does this app pull in, directly and transitively?" both are enough.
Vulnerabilities and VEX
CycloneDX can embed vulnerability records and VEX statements (whether a product is actually affected by a CVE) in the BOM or in a separate document. In SPDX 2.x, security data is usually linked through external references; SPDX 3.0 adds a Security profile that models vulnerabilities and VEX-style assessments. If you plan to publish "not affected" statements to customers, check which form your customers' tools accept.
Licences
SPDX is the reference for licence data, and CycloneDX uses SPDX licence identifiers too. If legal teams need declared versus concluded licences, copyright text and file-level detail, SPDX is the stronger choice.
Generating both SBOM formats with Syft
Syft by Anchore generates SBOMs from container images, directories and archives, and writes several formats in one run. Use -o format=file to write each output to a file:
From a container image, writing both formats:
syft alpine:3.20 \ -o cyclonedx-json=sbom.cdx.json \ -o spdx-json=sbom.spdx.json From a project directory:
syft dir:. -o cyclonedx-json=sbom.cdx.json You can pin a specification version with @, for example -o cyclonedx-json@1.5 or -o spdx-json@2.3, which helps when a consumer only supports older versions (Syft format docs).
Scanning an SBOM for vulnerabilities with Grype
Grype reads Syft JSON, SPDX and CycloneDX SBOMs and matches the components against its vulnerability database:
grype sbom:./sbom.cdx.json grype sbom:./sbom.spdx.json --fail-on high --fail-on high makes Grype exit with a non-zero code when it finds a vulnerability of high severity or above, which is handy as a CI gate. Scanning an SBOM instead of the image itself is faster, and lets you re-check old releases against new vulnerability data without rebuilding them.
A GitHub Actions step might look like this:
- name: SBOM and vulnerability gate run: | syft dir:. -o cyclonedx-json=sbom.cdx.json grype sbom:./sbom.cdx.json --fail-on critical Start with critical and tighten later; a gate that fails every build on day one tends to get switched off.
How to choose between SBOM formats
Ask these questions in order:
- Has a customer, regulator or contract named a format? Use that one.
- Is the main use vulnerability management? CycloneDX, especially if you want VEX in the same ecosystem.
- Is the main use licence compliance or open-source audit? SPDX.
- Do your existing tools prefer one? Check what your scanner, artifact registry and dependency-tracking platform import best.
- Still unsure? Generate both. Storage is cheap; converting later is harder.
Common mistakes with SBOMs
- Generating once and filing it away. An SBOM belongs to a specific build. Generate it in CI for every release and store it with the artifact.
- Empty or partial package identifiers. Without purls or CPEs, matchers miss components. Spot-check a few entries.
- Scanning only the source tree. A container image includes OS packages that the lockfile never mentions. Scan the image too.
- Treating the SBOM as the answer. It is an inventory. The value comes from matching it against vulnerability data again and again.
- Ignoring version differences. CycloneDX 1.4 and 1.6, or SPDX 2.3 and 3.0, are not always interchangeable for every consumer.
From SBOM to prioritised findings
An SBOM shows what you ship; the next job is deciding which vulnerable components to fix first and getting them to the right owner. CerberusGuard accepts CycloneDX and SPDX SBOMs, common lockfiles (npm lock, requirements.txt, poetry.lock, pom.xml, go.sum, Gemfile.lock, composer.lock) and container images via Syft, then matches components with Grype, an offline OSV index and the OSV API. Findings are scored with CVSS, EPSS, CISA KEV and asset value, assigned owners and due dates, and can be exported to your SIEM or as CSV and PDF reports. Prioritise and export findings with CerberusGuard.
Originally published at CerberusGuard blog.

