Sub topic 2
CVEs, severity and fixed versions
This chapter assumes you can pull and build images and use a terminal. You should also know that an image contains installed packages, which come from its base image and your own RUN steps. Scanners compare those packages against public vulnerability data. To read their output, you need to understand three things: the CVE identifier, the severity rating, and the fixed version.
What a CVE is
A CVE (Common Vulnerabilities and Exposures) entry is a public record of one known security flaw. Each has an identifier in the form CVE-YEAR-NUMBER, for example CVE-2024-00000. The year is when the ID was reserved or published. It is not a measure of how old or how serious the flaw is.
A CVE record names the affected software and versions and describes the flaw. It does not say whether your image is exploitable. That depends on how your application uses the package.
Where scanners get their data
A scanner does not discover flaws. It reads the package list from the image, then looks each package and version up in advisory databases. These include the National Vulnerability Database (NVD), distribution security trackers such as those for Debian, Alpine and Ubuntu, and language advisories for ecosystems such as Python, Go and npm.
Each source can rate the same CVE differently or record a different fixed version. This is the main reason two tools can report different results for the same image, which a later chapter covers.
Severity ratings
Most CVEs carry a CVSS (Common Vulnerability Scoring System) score from 0.0 to 10.0. Tools group the score into a severity label.
| Severity | CVSS v3 score |
|---|---|
| Low | 0.1 to 3.9 |
| Medium | 4.0 to 6.9 |
| High | 7.0 to 8.9 |
| Critical | 9.0 to 10.0 |
A distribution may override the score with its own label. Debian, for example, may mark a flaw as low priority because the vulnerable code path is not reachable in its build. Some findings show as UNKNOWN when no source has rated them yet.
Severity measures the flaw in general. It does not measure the risk in your deployment. A critical flaw in a library your container never loads is less urgent than a medium flaw in a service exposed to the internet.
Fixed versions
The most actionable field in a scan result is the fixed version. It is the first package version that contains a patch for the CVE. A typical finding has these parts:
| Field | Example |
|---|---|
| Package | `libexpat1` |
| Installed version | `2.5.0-1` |
| CVE | `CVE-2024-00000` |
| Severity | High |
| Fixed version | `2.5.0-1+deb12u1` |
If a fixed version is listed, the fix is to get that version or a newer one into the image. You can usually do this by rebuilding on an updated base image, or by upgrading the package in your Dockerfile.
If the fixed version is empty, no patch exists yet. You cannot fix the finding by upgrading. You can only replace the package, remove it, or accept the risk. Scanners can hide such findings, which the Trivy chapters show.
flowchart TDThe diagram below shows the decision you make for each finding.
Exercises
Exercise
A scan reports a High CVE in a package, and the fixed version column is empty. Can you resolve it by rebuilding on the latest base image? What are your options?
Show answer
Not necessarily. An empty fixed version means no patched release exists, so a rebuild will not remove the finding unless the base image has dropped or replaced the package. You can remove the package if the image does not need it, switch to a base image that does not include it, or accept the risk and record why.
Exercise
Why can the same CVE appear as Medium in one scanner and High in another?
Show answer
Scanners use different advisory sources. One may use the NVD CVSS score, while another uses a distribution's own rating, which can be lower or higher for that build.