SBOM Viewer
Operator: Abdulla Al Fahad. How tools are built and checked
A software bill of materials is supposed to answer "what is in this build?", but the file that arrives is a few thousand lines of JSON or XML in one of four dialects, and the useful answers are scattered through it: which licences are present, which packages appear twice, which have no licence at all, and why a particular package is there.
This viewer reads CycloneDX (JSON and XML) and SPDX 2.x (JSON and tag-value) into one component table. It groups every licence into a risk category, draws the dependency relationships as a tree you can open level by level, finds packages present in more than one version, lists components with no stated licence and checks the document against the seven NTIA minimum elements.
Everything is computed from the file alone. No vulnerability database is consulted, because that needs a network lookup; that limitation is stated on screen and in the Markdown export.
Key features
- CycloneDX 1.x JSON and XML with nested components, metadata component, tools and authors, and the dependencies graph
- SPDX 2.x JSON and tag-value, with DEPENDS_ON, DEPENDENCY_OF, CONTAINS and related relationship types folded into one direction
- Licence categories: permissive, public domain, weak copyleft, strong copyleft, network copyleft, restricted, unrecognised and missing, evaluated through SPDX expressions with AND, OR, WITH and parentheses
- Dependency tree with loop markers, depth and reachability counts, and the shortest paths that explain why a component is included
- CSV of all components and an escaped Markdown report
How four SBOM dialects become one component list
CycloneDX stores each component with a bom-ref, name, version, optional purl (package URL) and licences, and keeps relationships in a separate dependencies array of ref and dependsOn entries. SPDX describes packages with an SPDXID and keeps relationships as triples such as SPDXRef-app DEPENDS_ON SPDXRef-lib. The page normalises both into a component list and a map from each component to the components it depends on, so every view works the same way whichever format came in.
Licence strings are read as SPDX expressions. MIT OR Apache-2.0 counts as the less restrictive of the two, MIT AND GPL-3.0-only as the more restrictive, and GPL-2.0-only WITH Classpath-exception-2.0 as weak copyleft because of the linking exception. A free-text name such as Apache License 2.0 is matched to its SPDX identifier when it is a common one; anything else is shown as unrecognised instead of being guessed.
SPDX 3.0 JSON-LD is a different model and is not read, and a file carrying an @context is recognised as that format and left unread.
How it works
Components are keyed by bom-ref or SPDXID. Duplicates are found by purl without its version (npm/lodash) or by group and name, and a package counts as duplicated when two or more different versions are present.
The graph walk is breadth-first from the root components, counting each level once, and a separate iterative depth-first pass counts loops by finding edges that point back at an ancestor. Nothing recurses over the data, so a cyclic or very deep graph cannot overflow the stack.
When this helps
- A procurement team receives an SBOM with a supplier contract and filters to strong copyleft. Two GPL-3.0-only packages turn up, one of them a direct dependency of the product, so those two need a legal decision before signing.
- A platform engineer wants to retire an old lodash 3.x. The duplicates tab shows 3.10 and 4.17, and the paths view lists the three components that still resolve the old one, which turns the clean-up into a short list of upgrades.
- A compliance analyst exports the components CSV, sorts by category, and finds 14 of 212 components with no licence. The list goes to the build team with the purl of each so they can fix the generator's licence detection.
- An auditor checks the NTIA minimum elements on a vendor SBOM and finds that no component names a supplier. That becomes a written request to the vendor, since a missing element cannot be filled in from the file.
Opening a file
- Drop a CycloneDX or SPDX file or paste the document; the Load example button opens a small bundled CycloneDX file.
- Filter the Components tab by licence category, and select a name to see the shortest paths from the root to it.
- Open Duplicates and Missing data for packages in several versions and for components with no licence.
Example
The bundled trail-api.cdx.json (CycloneDX 1.5, 11 components)
express, body-parser, two versions of lodash, sharp, libvips-bindings (LGPL-3.0-or-later), gpx-geo (GPL-3.0-only), tile-cache (no licence), dual-licensed ((MIT OR GPL-2.0-only))What the tabs report
Categories: 8 permissive, 1 weak copyleft, 1 strong copyleft, 1 missing
Duplicate: lodash 3.10.1 and 4.17.21
Why lodash@4.17.21: trail-api > express > lodash, and trail-api > tile-cache > lodash
10 of 11 components reachable, depth 2; readline-sync is not linked to the rootLimits
Licence categories are a screen built from SPDX identifiers, not legal advice. Whether a copyleft licence applies depends on how the code is used and distributed.
Because there is no vulnerability lookup, a clean-looking SBOM says nothing about known CVEs. Match the purls against a vulnerability database separately.
The tool trusts what the file states. A generator that omits transitive dependencies, or fills every licence with NOASSERTION, produces a file that looks complete and is not.
CycloneDX dependencies are matched on bom-ref. A file whose refs do not match its components shows unresolved references and an empty graph.
Components from metadata.component are treated as the root of the graph; SPDX roots come from DESCRIBES relationships and documentDescribes.
- Search for the purl type you care about, for example pkg:maven, to review one ecosystem at a time.
- When a component shows an OR expression, read the licence text in the table: the category assumes you may pick the less restrictive licence, which is a legal choice and not a given.
Common errors and how to fix them
- "The JSON is neither CycloneDX (bomFormat) nor SPDX (spdxVersion)"
- A CycloneDX document has "bomFormat": "CycloneDX" at the top and an SPDX one has "spdxVersion": "SPDX-2.3" or similar. A VEX or SARIF file looks alike but is a different document.
- "The document declares entities in a DOCTYPE. They are not expanded, so the file was not opened."
- CycloneDX XML does not use DTD entities. Remove the DOCTYPE section, or regenerate the file.
What the NTIA elements count
The July 2021 NTIA report on minimum elements lists supplier name, component name, version, other unique identifiers, dependency relationships, author of the SBOM data and timestamp. The Missing data tab counts how many components carry each of the first four, how many components appear in the dependency data, and whether the document names an author or tool and a creation time. In the example every component has a name, version and identifier, one has a supplier, six have dependency entries, and the author and timestamp are present.
These are counts of what the file says, not a conformance verdict: a component can have a supplier field that holds nonsense.
SPDX tag-value quirks
Tag-value files interleave package, file and snippet sections. The reader starts a package at each PackageName line and attaches the SPDXID that follows it; an SPDXID that comes after a FileName line belongs to the file and is skipped. Values inside <text> blocks may span lines. A licence taken from PackageLicenseConcluded is used when it is a real value, and PackageLicenseDeclared otherwise; NOASSERTION and NONE both count as missing.
Frequently asked questions
Should I open an SBOM or the lockfile itself?
If you have the lockfile for a single npm project, the npm lockfile analyzer on this site reads package-lock.json directly. An SBOM is the right input when the file comes from someone else or covers several ecosystems, because the standard formats also carry Maven, Python, container image and mixed-project components.
Why is a package counted as permissive when its expression includes a GPL option?
For an OR expression the page uses the least restrictive choice, because the licensee may pick either licence. The table keeps the full expression so you can see what was offered.
Can it merge two SBOMs?
No. It reads one document at a time. Export the components CSV from each and compare them in a spreadsheet.