SPDX 3.0 and CycloneDX Diverge on License Field Semantics
Two SBOM formats can describe the same component and still disagree about its license. SPDX 3.0 and CycloneDX both carry license data, but the fields mean different things and nest differently. Anyone moving a scanner's output between them, or feeding both into one policy engine, hits the gap. This piece maps the divergence at the field level and shows where round-tripping loses information.
Two BOM Formats, One License Field
SPDX grew out of a Linux Foundation effort to standardise how components, licenses, and copyrights get exchanged. CycloneDX came from the security side, built around dependency and vulnerability data first. Both now cover licensing, and both accept the SPDX license list as a vocabulary. That shared vocabulary hides a structural difference: the two formats do not agree on what a license field is for.
In SPDX, a license assertion is a claim with a provenance. In CycloneDX, a license entry is closer to a label attached to a component. Those are different objects. A tool that reads one as if it were the other will silently drop the distinction between what a supplier declared and what an auditor concluded.
The practical cost shows up in policy engines. A rule that allows MIT and rejects GPL-family licenses works cleanly when the input is a parsed SPDX expression. Feed it a CycloneDX entry that carries only a free-text name, and the rule has nothing to match on. The scanner did its job. The consumer still cannot decide.
SPDX 3.0 License Expression Model
SPDX 3.0 reorganised the document around profiles and elements. A software package element carries license information as properties rather than as a single string. The two that matter most are the concluded license and the license information found in the files themselves. They answer different questions and are allowed to disagree.
A concluded license is the analyst's judgement after review. License info in file is what a scanner observed in headers and metadata. Keeping them apart lets a reviewer record that a package declares MIT while a handful of files carry a different notice. Collapsing them into one field destroys exactly the evidence a legal review needs.
Expressions follow the SPDX license list grammar. Simple identifiers combine with AND and OR, and exceptions attach with WITH, so a dual-licensed package or a license-plus-exception pair has a canonical, parseable form. Version 3.0 also lets license information attach at element level, which means a document can make assertions about more than just the top-level package.
There is a third property worth knowing about: the declared license, which records what the supplier or upstream project states, independent of any review. A package can therefore carry a declared MIT, a concluded MIT, and a file-level finding of a BSD-style notice in one vendored header, all in the same document. Three fields, three provenances, one component. Tools that read only the first non-empty field they find will report whichever one happens to sort first in the serialisation, which is not a stable answer across writers.
CycloneDX License Array Shape
CycloneDX puts licensing on a component as a licenses array. Each entry is an object that may hold an SPDX identifier, a free-text name, or an expression. An entry can carry a license URL too. The array is flat: there is no separate concluded field, and no structural split between what was declared and what was found.
SPDX identifiers are accepted but not required. A producer can write a name string and stop there. That is convenient for ecosystems where no SPDX identifier exists, and it is the main source of loss when data moves toward SPDX. A name like a project's custom license text has no identifier to map to, so the mapping step has to invent a decision or record an unknown.
The array shape also means one component can list several entries with no operator between them. Whether that means a choice or a conjunction is left to the consumer. SPDX makes the operator explicit with OR and AND. CycloneDX leaves the relationship implicit in the array, which is a real difference in expressiveness, not a formatting quirk.
Version 1.5 of the CycloneDX specification added an acknowledgement field that lets a producer say how a license entry was determined, which narrows the gap somewhat. It is optional, and in practice most generators leave it out. Optional provenance is provenance you cannot rely on when the document arrives from a third party.
Where the Wire Formats Clash
The first clash is directional. A scanner that emits SPDX expressions produces strings like a conjunction of two identifiers with an exception attached. A CycloneDX consumer expecting an array of objects has to parse that string, split it, and rebuild entries. Get the split wrong and the exception lands on the wrong identifier.
The second clash is identity loss. A CycloneDX entry that carries only a name has no SPDX identity. Mapping it back requires a lookup table, and those tables drift between releases as identifiers get added or deprecated. A mapping that resolved last quarter may miss a license added since, and the failure is quiet unless the tool logs it.
WITH exceptions flatten differently in each format, which is the third clash. SPDX treats the exception as part of the expression and keeps it attached. A flatter representation can lose the pairing and leave a bare license identifier that reads as more permissive than the original. Consumers then see two different license truths for the same component.
Operator precedence is the fourth, and the one that bites hardest in code review. SPDX defines AND as binding tighter than OR, so an expression mixing both parses one way and only one way. When that expression is decomposed into a flat array, the grouping disappears. A consumer that re-derives grouping by assuming left-to-right evaluation will produce a different tree than the producer intended, and the difference only shows up on components that actually mix the two operators. In a typical dependency graph that is a small minority of packages, which is precisely why the bug survives testing.
The trade-off is real. CycloneDX's flexibility serves projects with bespoke license text and no identifier, and forcing everything into SPDX identifiers would exclude them. SPDX's stricter model serves automated policy, where an unparseable field is worse than a missing one. Neither side is wrong; the cost lands on whoever has to translate.
Practical Mapping and Tooling Checks
Normalise to the SPDX license list before anything else. Parse every expression with a real parser rather than string matching, then resolve each identifier against a pinned copy of the list. That gives one canonical form to compare, and it surfaces identifiers that no longer exist instead of passing them through.
Treat the CycloneDX name field as lossy by default. When a name maps to a known identifier, record the mapping and the confidence. When it does not, store the raw string and flag it. Silent best-guess mapping is how a permissive license ends up attached to a component that never carried one.
Round-trip test both directions. Take a fixture set with compound expressions, exceptions, and name-only entries, convert SPDX to CycloneDX and back, and diff the result. The diffs are your real specification. Pin the schema versions in CI so a format revision does not change parsing behaviour underneath a passing build. This site has argued before that CI infrastructure rests on few maintainers, and schema pinning is one place where that fragility bites.
Keep a canonical internal representation that is richer than either wire format, and treat both SPDX and CycloneDX as serialisation targets rather than as your source of truth. Store concluded, declared, and observed license data as separate slots internally, even when the target format only has room for one. When the target is CycloneDX, write the most defensible slot and record the rest in a document-level annotation or a sidecar. That way a later migration to a stricter format does not require re-scanning the entire inventory.
Actions Before Your Next SBOM Release
Audit which format your scanner actually emits, and check whether it writes concluded and declared license data as separate fields or collapses them. Many tools emit one and claim the other in their documentation.
Add a round-trip license test to CI using fixtures that include a dual-license expression, a WITH exception, and a name-only CycloneDX entry. Fail the build when the diff is non-empty rather than logging a warning nobody reads.
Map every CycloneDX name-only entry in your current inventory to an SPDX identifier or an explicit unknown, and keep the raw string alongside the mapping so the decision can be reviewed later.
Pin the SPDX 3.0 and CycloneDX schema versions your pipeline validates against, and record the pinned versions in the SBOM metadata itself so downstream consumers know which grammar produced the document.
Document the concluded-versus-declared gap in your own policy rules. If your engine only reads one of the two, say so in the rule file, because a downstream team will otherwise assume both were checked. The same discipline applies to build pipelines that quietly change their inputs.