SBOM vs VEX: what each answers and why you need both

By the CapyShield team · · 4 min read

In short

An SBOM is an inventory of the components in your software; a VEX document states, per vulnerability, whether the product is affected, not affected, fixed or under investigation. The SBOM lets anyone match components against vulnerability databases, and VEX removes the matches that don't apply. Produce both from the same build and let scanners such as Trivy apply one to the other.

An SBOM answers "what is in this software?". A VEX document answers "which known vulnerabilities in those components actually affect this software?". You need the SBOM so anyone can match your components against vulnerability databases, and you need VEX so the result of that match isn't a list of hundreds of findings that mostly don't apply.

What is an SBOM?

A Software Bill of Materials is a machine-readable inventory of the components in a piece of software, with their versions and how they relate. The NTIA's minimum elements define the baseline data fields for each component:

  • Supplier name
  • Component name
  • Version of the component
  • Other unique identifiers, such as a package URL (purl)
  • Dependency relationship
  • Author of the SBOM data
  • Timestamp

The two common formats are SPDX and CycloneDX. Either way, an SBOM is a statement of fact about composition. It says nothing about whether a vulnerability in a listed component can be exploited in your product, and it isn't meant to.

What is VEX?

VEX (Vulnerability Exploitability eXchange) is a statement, per product and per vulnerability, of the product's status. The CISA-coordinated minimum requirements define four statuses:

  • not_affected: the vulnerability can't be exploited in this product. It must come with a justification, such as component_not_present, vulnerable_code_not_present, vulnerable_code_not_in_execute_path, vulnerable_code_cannot_be_controlled_by_adversary or inline_mitigations_already_exist, or with a free-text impact statement.
  • affected: action is needed, and the statement should say what (upgrade, mitigate).
  • fixed: these product versions contain a fix.
  • under_investigation: not known yet.

VEX can be expressed in CycloneDX, in CSAF, or in OpenVEX, a small JSON format designed to meet the minimum requirements and be easy to embed. Time matters: a statement is valid as of when it was made, and a later statement can supersede it as the investigation progresses.

Why isn't an SBOM enough on its own?

Because matching an SBOM against vulnerability databases is package-level. If a component version has a CVE, every SBOM that lists that version gets the finding, whether the product imports the vulnerable code, calls the vulnerable function, or only uses the package in tests. Publishing an SBOM without VEX hands your customers that full, unfiltered list and lets each of them triage it separately.

The noise is real. In the CapyShield demo project, Trivy reported 22 CVEs. Checked against the code, 6 were reachable from production, 2 were in a package only tests import, and 14 were transitive and needed review. The SBOM is correct in all 22 cases; it just doesn't answer the question the reader has.

The two documents also change at different rates, which is another reason to keep them separate:

  • An SBOM changes when the build changes. The same release always has the same components, so its SBOM can be produced once and attached to the release.
  • VEX changes when knowledge changes. A new CVE published next month against a component in last month's release needs a new statement about that release, even though not a single byte of it changed.

Bundling the two would force you to reissue the inventory every time a vulnerability is triaged. Keeping them apart lets the SBOM stay fixed and lets VEX statements accumulate over the life of the release.

Who reads SBOMs and VEX documents?

  • Customers' security teams load your SBOM into their own scanners and asset inventories. Without VEX, every finding becomes a question to you.
  • Auditors and regulators increasingly expect an SBOM as part of software supply chain due diligence, and a record of how you assessed each known vulnerability in it.
  • Your own engineers, when a widely publicized CVE lands: the SBOM tells you in seconds which releases contain the component, and VEX tells everyone else whether they need to care.

How do SBOM and VEX work together in a pipeline?

Produce both from the same build, ship them together, and let scanners apply the VEX to the SBOM. With Trivy and the CapyShield CLI:

terminal
# 1. Inventory: a CycloneDX SBOM of what ships.
trivy fs --format cyclonedx --output sbom.cdx.json .

# 2. Findings, then triage by reachability into OpenVEX.
trivy fs --format json -o trivy.json .
capyshield vex --input trivy.json --repo . --output release.openvex.json --fail-on high,critical

# 3. Anyone with both files gets only what applies.
trivy sbom sbom.cdx.json --vex release.openvex.json

capyshield vex reads Trivy, Grype or OSV-Scanner JSON, checks each finding against your lockfiles and production imports, and writes OpenVEX v0.2.0. A dev_only package, or a direct dependency that production code never imports, becomes not_affected with vulnerable_code_not_in_execute_path; a package imported in production becomes affected with an upgrade action_statement; anything else stays under_investigation. The facts behind each decision are kept in the statement's status_notes, and SOURCE_DATE_EPOCH makes the file byte-for-byte reproducible, so it can be signed and attached to a release next to the SBOM.

Can VEX be generated automatically, and should you trust it?

Partly, and only as far as the analysis behind it goes. A VEX statement is a claim made by its author, so an automated one should be conservative and explain itself. CapyShield's reachability is static and package-level: it uses lockfiles and import statements, not call graphs. That is why transitive packages production code doesn't import directly are reported as under_investigation rather than guessed as safe, and why code loaded dynamically at runtime can be missed.

The rest is human judgment, recorded as data. Local rules in .capyshield/vex-rules.yaml win over automatic decisions, carry a justification or impact statement, and are versioned with the code:

yaml
rules:
  - vulnerability: CVE-2020-14343
    package: PyYAML
    status: not_affected
    justification: vulnerable_code_cannot_be_controlled_by_adversary
    impact_statement: "Only yaml.safe_load on trusted config files."

That split, machine-derived facts plus reviewed human decisions, is what makes a VEX document something a customer or auditor can rely on. The CLI is open source, and the docs show how to run it in CI.

Frequently asked questions

What is the difference between an SBOM and VEX?
An SBOM lists the components and versions in a piece of software. VEX states whether a specific vulnerability affects that software, with a status and a justification.
What are the VEX statuses?
not_affected, affected, fixed and under_investigation. A not_affected statement must include a justification, such as vulnerable_code_not_in_execute_path, or an impact statement.
Which formats support VEX?
OpenVEX, CycloneDX and CSAF can all express VEX. OpenVEX is a small JSON format built to meet the CISA-coordinated minimum requirements.
Can I apply a VEX file to an SBOM scan?
Yes. Trivy, for example, accepts --vex when scanning an SBOM, as in trivy sbom sbom.cdx.json --vex release.openvex.json, and suppresses findings the VEX marks as not affected.

Sources