Guides / Basics

Reading a Trivy report: columns, statuses, severity and what to do next

beginnerUpdated 26 Nov 2026999 words

Trivy is a free scanner from Aqua Security for container images, file systems and SBOMs. Its reports are long, and the first one usually alarms people. The report below is a scan of python:3.12.8-slim, an image built on Debian 12.9 that has not been updated since, read line by line. The findings are typical for any image that is a year or two old.

Running the scan

trivy image --scanners vuln python:3.12.8-slim                 # an image
trivy fs --scanners vuln /srv/app                              # a directory with lockfiles
sudo trivy rootfs --scanners vuln /                            # the running host
trivy image --scanners vuln --format json -o report.json python:3.12.8-slim

--scanners vuln skips the secret scan, which is slow on large images. The example below was made with Trivy 0.75.0 on 2026-11-26, scanning the file system of the image; trivy image gives the same findings with the image name as the target.

The summary

Trivy first lists what it scanned:

┌──────────────────────────────────────────────────────────────────────┬────────────┬─────────────────┐
│                                Target                                │    Type    │ Vulnerabilities │
├──────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤
│ 79af7a5022c7 (debian 12.9)                                           │   debian   │       52        │
├──────────────────────────────────────────────────────────────────────┼────────────┼─────────────────┤
│ usr/local/lib/python3.12/site-packages/pip-24.3.1.dist-info/METADATA │ python-pkg │        0        │
└──────────────────────────────────────────────────────────────────────┴────────────┴─────────────────┘

Each target is one source of packages: the Debian package database, and the metadata of each Python package. The counts depend on the filters; this table was made with --severity HIGH,CRITICAL --ignore-unfixed.

Without filters the scan found 581 vulnerabilities: 575 in 105 Debian packages, 6 in pip.

Severity Count
CRITICAL 9
HIGH 145
MEDIUM 237
LOW 165
UNKNOWN 25
Status Count
fixed 199
affected 300
fix_deferred 68
will_not_fix 14

The table

Two rows, with the titles shortened:

│ Library  │ Vulnerability  │ Severity │ Status       │ Installed Version │ Fixed Version    │ Title                             │
│ libssl3  │ CVE-2026-31789 │ CRITICAL │ fixed        │ 3.0.15-1~deb12u1  │ 3.0.19-1~deb12u2 │ openssl: OpenSSL: Heap buffer ... │
│ zlib1g   │ CVE-2023-45853 │ CRITICAL │ will_not_fix │ 1:1.2.13.dfsg-1   │                  │ zlib: integer overflow and ...    │
  • Library: the installed package, for OS packages the binary package name. One fix often shows up several times: CVE-2026-31789 appears for both libssl3 and openssl, two binary packages built from the same source.
  • Vulnerability: CVE ID, or GHSA or distribution ID when there is no CVE.
  • Severity: from the data source Trivy matched (the distribution for OS packages, GHSA for Python packages), or from the NVD and other vendors when the source does not rate it. UNKNOWN means nobody has rated it yet.
  • Status: fixed means a fixed version exists. affected means the distribution knows the package is affected and has not released a fix. will_not_fix and fix_deferred are decisions of the distribution; see unfixed vulnerabilities.
  • Installed Version and Fixed Version: in the version scheme of the distribution. Compare them with dpkg --compare-versions, not by eye; see backports and version numbers.
  • Title: a short description and a link with details.

The JSON fields worth knowing

The JSON report has the same findings with more fields:

jq '.Results[0].Vulnerabilities[] | select(.VulnerabilityID == "CVE-2023-45853")
    | {PkgName, InstalledVersion, Status, Severity, SeveritySource, VendorSeverity, DataSource}' report.json
{
  "PkgName": "zlib1g",
  "InstalledVersion": "1:1.2.13.dfsg-1",
  "Status": "will_not_fix",
  "Severity": "CRITICAL",
  "SeveritySource": "nvd",
  "VendorSeverity": { "amazon": 2, "azure": 3, "cbl-mariner": 4, "ghsa": 4, "julia": 4,
                      "nvd": 4, "photon": 4, "redhat": 2, "ubuntu": 2 },
  "DataSource": { "ID": "debian", "Name": "Debian Security Tracker" }
}

VendorSeverity uses numbers: 1 low, 2 medium, 3 high, 4 critical. This finding is CRITICAL because Debian does not give it a severity and Trivy fell back to the NVD; Red Hat and Ubuntu rate it medium. The Debian tracker explains why it is not fixed: the vulnerable MiniZip code is in the zlib source, but Debian does not build it into the zlib1g package. On this system the CRITICAL finding is not exploitable. Language package findings also carry PkgPath, the file the package was found in.

Useful jq recipes

Counts by severity and status:

jq -r '[.Results[].Vulnerabilities[]?] | group_by(.Severity) | map("\(.[0].Severity) \(length)") | .[]' report.json
jq -r '[.Results[].Vulnerabilities[]?] | group_by(.Status) | map("\(.[0].Status) \(length)") | .[]' report.json

The OS packages that have a fix, ready for apt-get install --only-upgrade:

jq -r '.Results[] | select(.Class == "os-pkgs") | .Vulnerabilities[]?
       | select(.Status == "fixed") | .PkgName' report.json | sort -u

For this image that is 30 packages. Critical and high findings with a fix, one line each:

jq -r '.Results[].Vulnerabilities[]? | select(.Status == "fixed" and (.Severity == "CRITICAL" or .Severity == "HIGH"))
       | "\(.PkgName) \(.InstalledVersion) -> \(.FixedVersion)"' report.json | sort -u

Matches with the CISA KEV list: see CISA KEV explained. This image had none.

What the report does not show

The Python interpreter in this image was compiled from source into /usr/local. It is not a Debian package and does not have Python package metadata, so Trivy 0.75.0 did not list it at all, and CVEs fixed in later Python releases do not appear. Check software you build or copy in yourself separately; the guide on how scanners work lists other blind spots.

What to do with this report

  1. Rebuild on an updated base image. Debian has already shipped fixes for the 199 findings with status fixed. A rebuild on a current base image, or apt-get upgrade during the build, installs them.
  2. Look at what remains with severity critical or high and status affected. Read the distribution tracker for each; many concern code paths that are not reachable in a container.
  3. Leave the rest to regular rebuilds. Track the totals over time instead of each line.

Sources

Check your servers every day

The agent of Patchbrief reports the packages and settings of a server once a day; the digest names what to fix first.

Start free