CCyberwiki

CycloneDX and SPDX

CycloneDX and SPDX
TypeFile formats for a software bill of materials
CycloneDXVersion 1.7 (October 2025), standardised as ECMA-424; OWASP Foundation and Ecma International
SPDXVersion 3.0.1; ISO/IEC 5962:2021 followed version 2.2.1; The Linux Foundation
EncodingsCycloneDX: JSON, XML, Protocol Buffers. SPDX 3: any RDF format, such as JSON-LD, Turtle, N-Triples or RDF/XML
RelatedSBOM, VEX, SCA

A JSON file whose first field is "bomFormat": "CycloneDX" and one whose top-level @context points at spdx.org carry the same kind of content: a software bill of materials listing the packages inside an application, their versions and licences, and which package needs which. CycloneDX and SPDX are the two formats in which such inventories are usually written. CycloneDX is an Ecma standard and SPDX an ISO one.12

Origins

SPDX is the older of the two. Drafting began in February 2010 under the name Package Facts, in a working group of the Linux Foundation, and version 1.0 in August 2011 described packages. Version 2.0 (May 2015) added multiple packages and relationships between packages and files; version 2.2 (May 2020) added SPDX-lite, which meets the minimum SBOM elements set by the US National Telecommunications and Information Administration (NTIA). Version 2.2.1 was prepared for submission to ISO in August 2020, and the standard ISO/IEC 5962 became available in August 2021. SPDX 3.0, with new Security, Build, Dataset and AI profiles, reached a release candidate in May 2023 and was released as 3.0.0 in April 2024.2

CycloneDX is developed by the OWASP Foundation together with Ecma International. Version 1.7 was released on 21 October 2025, and Ecma published it as the standard ECMA-424 on 10 December 2025, through its technical committee TC54.1

CycloneDX documents

A CycloneDX file must state its own format in the field bomFormat, because BOM files have no fixed file name and JSON Schema has no namespaces to tell one format from another. specVersion names the version of the specification the file follows. Each generated BOM should carry a new serialNumber, a unique ID in the RFC 4122 UUID form, even when nothing in it changed since the last run.3 Files are conventionally named bom.json, bom.xml or *.cdx.json.1

A component can carry a bom-ref, which must be unique within the file. The dependency graph is a separate list in which every entry names a component by that reference and gives, in dependsOn, the references of the components it needs.3 A shortened example for a project that uses Express, which in turn uses body-parser:

{
  "bomFormat": "CycloneDX",
  "specVersion": "1.7",
  "serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
  "components": [
    { "type": "library", "bom-ref": "express", "name": "express", "version": "4.21.2" },
    { "type": "library", "bom-ref": "body-parser", "name": "body-parser", "version": "1.20.3" }
  ],
  "dependencies": [
    { "ref": "express", "dependsOn": ["body-parser"] }
  ]
}

The graph can hold both direct and transitive dependencies.1 Besides software packages, components can be source code, hardware devices, machine learning models or configuration, and a services section records the external APIs the software calls, with their endpoints, authentication and the kinds of data sent to them. A compositions section marks each part of the inventory as complete, incomplete, incomplete first-party only, incomplete third-party only or unknown. A vulnerabilities section lists known flaws and how exploitable they are,1 so the same format carries VEX statements about whether a flaw can be exploited in a given product.4

SPDX documents

SPDX 3 is defined as an RDF data model, a graph of typed elements, and can be written in any RDF format, among them JSON-LD (JSON with a context that names what each key means), Turtle, N-Triples and RDF/XML. A JSON-LD file must reference the shared context file https://spdx.org/rdf/3.0.1/spdx-context.jsonld, which maps short names such as spdxId and type onto the underlying RDF terms. Conformance is tested twice: against a JSON Schema for structure, and against the SPDX OWL ontology, a machine-readable definition of every class and property, for meaning.5

The specification is split into nine profiles. Core is mandatory and the others (Software, Security, Licensing, Dataset, AI, Build, Lite, Extension) are optional; Core together with Software is the baseline for exchanging a bill of materials.6 A relationship is an element of its own with one from, one or more to and a required relationshipType. Two reserved values separate "this package has no dependencies" (NoneElement) from "nothing is claimed either way" (NoAssertionElement).7

SPDX licence expressions describe licensing that one identifier cannot. An expression combines identifiers from the SPDX License List with the operators AND, OR, WITH and +: GPL-2.0-only OR BSD-3-Clause means a choice of two licences, while LGPL-2.1-only AND BSD-3-Clause means both apply. A licence missing from the list is written as LicenseRef- followed by a name.8 The project states that SPDX records facts and makes no legal interpretation of them.2

Table 1. The two formats side by side
CycloneDX 1.7SPDX 3.0.1
StandardECMA-424ISO/IEC 5962:2021 (from version 2.2.1)
EncodingsJSON, XML, Protocol BuffersAny RDF format: JSON-LD, Turtle, N-Triples, RDF/XML
Dependenciesdependencies list with dependsOnRelationship elements
Vulnerability dataBuilt-in section, VEXSecurity profile
Beyond softwareServices, hardware, build formulationDataset, AI and Build profiles

Producing and converting

GitHub exports a repository's dependency graph as SPDX, with versions, package identifiers, licences and transitive paths. Of the GitHub Actions its documentation lists for building an SBOM in a workflow, two create SPDX 2.2 compatible files and one uploads a CycloneDX SBOM to GitHub's dependency submission API.9 Syft, an SBOM generator from Anchore, writes either format, or both at once:10

syft <image> -o spdx-json=./spdx.json -o cyclonedx-json=./cdx.json

Converting a file from one format to the other means mapping one data model onto another. The protobom library reads SPDX 2.2, 2.3 and 3.0.1 and CycloneDX 1.2 to 1.7 into a neutral protocol buffers structure in which an SPDX package and a CycloneDX component each become one node, then writes any of them back out; its authors state that it ingests both formats without loss.11

See also

References

  1. a b c d e "Specification Overview". CycloneDX. OWASP Foundation.
  2. a b c "Overview". SPDX. The Linux Foundation.
  3. a b "CycloneDX v1.7 JSON Reference". CycloneDX. OWASP Foundation.
  4. back "Vulnerability Exploitability eXchange (VEX)". CycloneDX. OWASP Foundation.
  5. back "Serializations". SPDX Specification 3.0.1. The Linux Foundation.
  6. back "Conformance". SPDX Specification 3.0.1. The Linux Foundation.
  7. back "Relationship". SPDX Specification 3.0.1, Core model. The Linux Foundation.
  8. back "SPDX license expressions". SPDX Specification 3.0.1, Annex B. The Linux Foundation.
  9. back "Exporting a software bill of materials for your repository". GitHub Docs. GitHub.
  10. back Anchore. "syft". GitHub.
  11. back "protobom". GitHub.