Safeguard
Supply Chain•

How do you diff two SBOMs to see what changed between releases?

Compare two SBOMs to see components added, removed and changed between releases with a CycloneDX diff, and learn how to read the output for risk.

Safeguard Security Team
3 min read

To diff two SBOMs, run a comparison tool on the old and new files and read three lists: components added, removed, and changed in version. The CycloneDX command line tool does this for CycloneDX files and prints text or JSON. The useful work is deciding which differences deserve a human look.

Steps

  1. Generate both SBOMs the same way. Same tool, same version, same options. Otherwise you compare tool differences, not release differences.
  2. Use the same format for both. If one is SPDX, convert it first.
  3. Run the diff.
cyclonedx-cli diff sbom-1.4.0.json sbom-1.5.0.json --component-versions
  1. Save the output with the release record.

The component versions option reports versions that were added, removed or modified. Output can be text, the default, or JSON for a pipeline.

Read the result in layers

ChangeWhat it often meansAction
New direct componentSomeone chose a new dependencyReview who maintains it and why it was added
New transitive componentA direct dependency pulled it inCheck which parent brought it
Version bumpedRoutine update or a fixCompare to advisories for the old version
Version droppedComponent removed or replacedConfirm the replacement is intended
Same name, two versionsDuplicate versions in the treeThe analyze command can list components used at more than one version
Unexpected removalGeneration gap or real changeRe-run before trusting it

The analyze command in the same tool reports components present at several versions, which is a quick duplicate check.

Common traps

  • Timestamps and serial numbers differ on every run. A good diff ignores them. Do not treat them as changes.
  • A change in your generation environment, such as a new base image, shows up as many changes at once.
  • Flat and hierarchical merged SBOMs diff badly against single service ones. Compare like with like.

When to diff automatically

Run the diff in your release pipeline and fail or flag only on rules you have agreed, for example any new component with a license outside policy, or a new component not on an approved list. Everything else goes into the release notes.

Try it yourself

Click through it at your own pace, or open it full screen.

Watch how a change over time is surfaced. That is the same idea as an SBOM diff, applied continuously.

Quick check

Can I diff an SPDX file against a CycloneDX file?

Convert one to match the other first. The CycloneDX tool converts between several formats, including SPDX JSON 2.3, though conversion can lose fields.

Why does my diff show everything changed?

Usually the two files were produced with different tools, options or environments.

Safeguard's SBOM and dependency scanning keeps a component inventory per project that you can compare over time, and a free scan is at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.