TExcelTAD
Home › Software Supply Chain Security: SBOM, SLSA & Sigstore › VEX: Saying "Not Affected" with OpenVEX

VEX: Saying "Not Affected" with OpenVEX

A scanner says "your image contains busybox 1.36.0-r9, and CVE-2022-48174 affects busybox before 1.36.1-r1". It can't know that the vulnerable code is in ash, a shell your service never runs. Someone who knows the product can. VEX (Vulnerability Exploitability eXchange) is the machine-readable way to write that knowledge down, so that every scanner, yours and your customers', stops reporting the finding, and so that the reason travels with the artifact.

Statuses and justifications

A VEX statement says: for this product (and optionally these components inside it), this vulnerability has this status.

Status Meaning Required extra
not_affected the product is not exploitable a justification (or an impact statement)
affected it is exploitable an action statement: what users should do
fixed this version contains the fix
under_investigation we're looking

The five standard justifications for not_affected:

Justification Example
component_not_present the scanner matched a package that isn't actually shipped
vulnerable_code_not_present the vulnerable function was compiled out or removed
vulnerable_code_not_in_execute_path the code is there but never called
vulnerable_code_cannot_be_controlled_by_adversary the input to it never comes from outside
inline_mitigations_already_exist a protection in the product blocks exploitation

There are three formats: OpenVEX (a small JSON format from the OpenSSF, used below), CycloneDX (its vulnerabilities[].analysis section) and CSAF 2.0 (the format of large vendors' advisories). Grype and Trivy both read OpenVEX.

An OpenVEX document

json
{
  "@context": "https://openvex.dev/ns/v0.2.0",
  "@id": "https://example.com/vex/node-app-1.0.0",
  "author": "Platform Security <security@example.com>",
  "timestamp": "2026-01-15T10:00:00Z",
  "version": 1,
  "statements": [
    {
      "vulnerability": { "name": "CVE-2021-23337", "aliases": ["GHSA-35jh-r3h4-6jhm"] },
      "products": [ { "@id": "pkg:npm/lodash@4.17.15" } ],
      "status": "not_affected",
      "justification": "vulnerable_code_not_in_execute_path",
      "impact_statement": "We never call _.template(); the injection is only reachable through it."
    }
  ]
}
  • products[].@id is usually a purl: of the component, or of the whole product with subcomponents listing the affected component purls.
  • vulnerability.name plus aliases make the statement match whichever id a scanner uses.
  • timestamp and version let consumers take the newest statement when several documents disagree.

Applying it to a lockfile scan

bash · try it yourself
cp -r /opt/samples/node-app . && cd node-app
cat > node-app.vex.json <<'JSON'
{
  "@context": "https://openvex.dev/ns/v0.2.0",
  "@id": "https://example.com/vex/node-app-1.0.0",
  "author": "Platform Security <security@example.com>",
  "timestamp": "2026-01-15T10:00:00Z",
  "version": 1,
  "statements": [
    {
      "vulnerability": { "name": "CVE-2021-23337", "aliases": ["GHSA-35jh-r3h4-6jhm"] },
      "products": [ { "@id": "pkg:npm/lodash@4.17.15" } ],
      "status": "not_affected",
      "justification": "vulnerable_code_not_in_execute_path",
      "impact_statement": "We never call _.template()."
    }
  ]
}
JSON
echo "grype without VEX: $(grype . -q -o json | jq '.matches | length')"
echo "grype with VEX:    $(grype . -q -o json --vex node-app.vex.json | jq '.matches | length')"
grype . -q -o json --vex node-app.vex.json | jq -c '.ignoredMatches[] | {id: .vulnerability.id, rule: .appliedIgnoreRules[0]}'
echo "trivy without VEX: $(trivy fs . -q -f json | jq '[.Results[].Vulnerabilities[]] | length')"
echo "trivy with VEX:    $(trivy fs . -q -f json --vex node-app.vex.json | jq '[.Results[].Vulnerabilities[]] | length')"
trivy fs . -q -f json --vex node-app.vex.json --show-suppressed | jq -c '.Results[].ExperimentalModifiedFindings[] | {id: .Finding.VulnerabilityID, Status, Statement, Source}'
grype without VEX: 7
grype with VEX:    6
{"id":"GHSA-35jh-r3h4-6jhm","rule":{"namespace":"vex","vex-status":"not_affected"}}
trivy without VEX: 8
trivy with VEX:    7
{"id":"CVE-2021-23337","Status":"not_affected","Statement":"vulnerable_code_not_in_execute_path","Source":"node-app.vex.json"}

Both scanners dropped exactly one finding and kept the evidence of why: Grype in ignoredMatches (a vex rule), Trivy in ExperimentalModifiedFindings with the justification and the file it came from.

Remove the aliases and Grype would not suppress anything: it reports this advisory as GHSA-35jh-r3h4-6jhm, and a statement naming only the CVE doesn't match. Trivy reports the CVE id, so it would. Always include aliases.

Products and components in an image

For an image, a statement can name the whole image (as a pkg:oci/… purl with its digest), a component inside it, or both. Component purls must match the scanner's purls, and the two scanners don't write Alpine purls identically (Syft: distro=alpine-3.18.0, Trivy: distro=3.18.0). A purl without version and qualifiers matches any version of the package in both:

bash · try it yourself
crane push /opt/samples/images/alpine-3.18.0.tar localhost:5000/demo/alpine:3.18.0 > /dev/null 2>&1
IMG=localhost:5000/demo/alpine@$(crane digest localhost:5000/demo/alpine:3.18.0)
vex() {   # vex <product json>: one not_affected statement for CVE-2022-48174
  cat > busybox.vex.json <<JSON
{ "@context": "https://openvex.dev/ns/v0.2.0", "@id": "https://example.com/vex/alpine-ash",
  "author": "Platform Security", "timestamp": "2026-01-15T10:00:00Z", "version": 1,
  "statements": [ { "vulnerability": { "name": "CVE-2022-48174" }, "products": [ $1 ],
                    "status": "not_affected", "justification": "vulnerable_code_not_in_execute_path",
                    "impact_statement": "The service never starts a shell." } ] }
JSON
  printf '  grype still reports it in: %s\n' "$(grype $IMG -q -o json --vex busybox.vex.json | jq -r '[.matches[] | select(.vulnerability.id == "CVE-2022-48174") | .artifact.name] | join(", ")')"
  printf '  trivy still reports it in: %s\n' "$(trivy image -q $IMG -f json --vex busybox.vex.json | jq -r '[.Results[].Vulnerabilities[] | select(.VulnerabilityID == "CVE-2022-48174") | .PkgName] | join(", ")')"
}
echo "no statement:";                 vex '{ "@id": "pkg:npm/unrelated" }'
echo "component, Syft-style purl:";   vex '{ "@id": "pkg:apk/alpine/busybox@1.36.0-r9?arch=x86_64&distro=alpine-3.18.0" }'
echo "component, versionless purl:";  vex '{ "@id": "pkg:apk/alpine/busybox" }'
no statement:
  grype still reports it in: busybox, busybox-binsh, ssl_client
  trivy still reports it in: busybox, busybox-binsh, ssl_client
component, Syft-style purl:
  grype still reports it in: busybox-binsh, ssl_client
  trivy still reports it in: busybox, busybox-binsh, ssl_client
component, versionless purl:
  grype still reports it in: busybox-binsh, ssl_client
  trivy still reports it in: busybox-binsh, ssl_client

Three lessons in one session:

  1. The exact purl only matched in Grype, whose cataloger produced that purl. Test VEX documents against the scanners your consumers use.
  2. CVE-2022-48174 is reported for three Alpine packages (busybox, busybox-binsh, ssl_client), all built from the busybox source. A statement about busybox covers only that one; list all three.
  3. A versionless purl is broader: it will also cover future busybox versions. Prefer exact versions for not_affected, since the analysis was done on one version.

Shipping VEX with the artifact

A VEX file in your repository only helps your own scans. Publish it with the artifact, as a signed attestation of type openvex (cosign attest --type openvex --predicate x.vex.json IMAGE, see Attestations) or next to your release downloads. Trivy can even discover VEX from an OCI registry (--vex oci) and from VEX repositories (--vex repo), and vexctl (OpenVEX's CLI) creates and merges documents.

Test yourself

Which OpenVEX status requires a justification?

  1. affected
  2. fixed
  3. not_affected
  4. under_investigation

A VEX statement names only CVE-2021-23337, but Grype reports the finding as GHSA-35jh-r3h4-6jhm. What happens?

  1. Grype resolves it automatically
  2. Grype doesn't suppress the finding unless the statement lists the GHSA as an alias
  3. Grype fails
  4. The finding becomes critical

Why is VEX better than an ignore rule for telling customers a CVE doesn't affect your image?

  1. VEX is shorter
  2. It is a standard document with a status and justification that their scanners can consume
  3. Ignore rules are illegal
  4. VEX deletes the vulnerability