Guides / Basics

How vulnerability scanners work, and why they disagree

intermediateUpdated 26 Nov 2026926 words

Run two vulnerability scanners on the same server and you get two different lists. Neither is necessarily wrong. A scanner does three things: it finds out what software is installed, it matches each package version against vulnerability data, and it decorates the result with severity and fix information. Each step has choices in it. Knowing them helps you tell a real finding from noise and spot what a scanner cannot see.

Step 1: inventory

The scanner first builds a list of packages, which is in effect an SBOM.

Operating system packages come from the package database:

Family Database OS release from
Debian, Ubuntu /var/lib/dpkg/status /etc/os-release
RHEL, Rocky, Alma, Fedora /var/lib/rpm /etc/os-release, /etc/redhat-release
Alpine /lib/apk/db/installed /etc/os-release, /etc/alpine-release

Language packages come from files that list dependencies: lockfiles (package-lock.json, poetry.lock, Gemfile.lock, composer.lock, Cargo.lock), installed package metadata (*.dist-info for Python, package.json files in node_modules), Java archives (pom.properties and MANIFEST.MF inside JARs), and the build information Go embeds in every binary.

What the inventory misses:

  • software built from source into /usr/local or /opt without package metadata;
  • libraries copied into an application (vendored), statically linked, or bundled by a vendor product;
  • anything in a format the scanner does not read.

A package that is not in the inventory cannot be matched. This is the main source of false negatives, and no amount of vulnerability data fixes it.

Step 2: matching

For each package the scanner looks up vulnerability records and compares versions.

For OS packages, good scanners use the data of the distribution: the Debian security tracker, Ubuntu CVE data, Red Hat security data, the Alpine security database, Amazon Linux advisories and so on. These sources name fixed versions in the version scheme of the distribution, such as 1:9.2p1-2+deb12u3 for OpenSSH on Debian 12, and the scanner compares with the rules of dpkg, rpm or apk.

For language packages, the sources are the GitHub Advisory Database, OSV and ecosystem databases, with the version rules of each ecosystem (semantic versions for npm and Go, PEP 440 for Python, Maven ordering for Java).

Matching against the NVD with product names (CPE) and upstream version ranges is the other approach. It works for software without distribution data, but it does not know about backports, and it is the classic source of false positives on Debian, Ubuntu and RHEL: a patched 9.2p1 package looks vulnerable to a bug "fixed in 9.8p1". See backports and version numbers.

Step 3: status and severity

The scanner then adds:

  • a status: fixed (an update exists), affected (no fix yet), will not fix, fix deferred, end of life. Distributions decide these for their packages.
  • a severity: the rating of the distribution for OS packages, or a CVSS-based rating from the advisory or the NVD.
  • enrichment: titles, references, sometimes EPSS and KEV.

Trivy for example takes the severity from the data source it matched, because the vendor knows how it builds and configures the package. Its documentation uses CVE-2023-0464 as the example: HIGH in the NVD, Low at Red Hat, so Trivy shows it as LOW on Red Hat systems. The guide on reading a Trivy report shows the fields.

Why two scanners disagree

Cause Effect
different data sources, or the same source fetched at a different time one scanner knows a CVE the other does not yet
unfixed findings shown or hidden by default very different counts for the same image
NVD matching versus distribution data false positives on patched distribution packages
different severity sources the same CVE is HIGH in one report, LOW in another
one finding per source package or per binary package openssl and libssl3 counted once or twice
aliases not merged a GHSA and a CVE for the same bug listed separately
inventory coverage one scanner reads JARs or Go binaries, the other does not
development dependencies in lockfiles findings for packages that are not in the image
several kernels installed findings for a kernel that is not running, or none for the one that is

End-of-life releases deserve a special mention. When a distribution stops publishing security data for a release, a scanner may report fewer findings than before, not more. A short report for Debian 10 or CentOS 7 is a warning sign, not a good result. Trivy prints a warning when it detects an end-of-life OS.

How to use this

  • Prefer distribution data for OS packages. Trivy, Grype and similar tools do this by default for the distributions they support.
  • Know what your scanner reads. Check its documentation for the languages, lockfiles and binary types it supports, and scan images as well as hosts.
  • Settle disagreements with the source. When two tools disagree about a CVE in an OS package, the security tracker of the distribution decides.
  • Count by CVE and package. Merge aliases and source/binary package pairs before you compare numbers.
  • Treat a sudden drop in findings as a question. A data source may have stopped, or the inventory step may have failed.

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