Guides / Basics

How vulnerability scanners work, and why they disagree

intermediateUpdated 26 Nov 2026886 words

Two vulnerability scanners run on the same server return two different lists, and neither has to be wrong. A scanner lists the installed software, matches each package version against vulnerability data, and adds severity and fix information. Tools make different choices at each of these steps.

Step 1: inventory

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

Operating system packages

They 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

They 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).

The other approach matches against the NVD with product names (CPE) and upstream version ranges. It works for software without distribution data, but it does not know about backports, and it is the usual 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:

Field Content
Status fixed (an update exists), affected (no fix yet), will not fix, fix deferred, end of life; distributions decide these for their packages
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. Reading a Trivy report explains 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

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

Using scanner results

  • For OS packages, prefer scanners that use distribution data. Trivy, Grype and similar tools do this by default for the distributions they support.
  • Check which languages, lockfiles and binary types your scanner reads, and scan images as well as hosts.
  • When two tools disagree about a CVE in an OS package, the security tracker of the distribution decides.
  • 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 Vulnpocalypse collector reports the packages and settings of a server once a day, and the digest lists what to fix, most urgent first.

Start free