Skip to content
Compliance engineering: CRA and AI Act on Kubernetes · Chapter 4 of 20 Day 3: Finding and assessing vulnerabilities – Grype, Trivy, CVSS, EPSS, KEV, false positives

Day 3: Finding and assessing vulnerabilities – Grype, Trivy, CVSS, EPSS, KEV, false positives

Goal: match the parts list against vulnerability databases with two scanners, classify the findings by severity, likelihood of exploitation and actual exploitation, recognise false positives and measurement errors, and record a decision for each group · Duration: about 120 min · Prerequisite: Day 2 completed

State before this chapter

# on werk1
git -C ~/lotse ls-files sbom

Expected:

sbom/bewerbungslotse-1.0.0.cdx.json
sbom/bewerbungslotse-1.0.0.spdx.json
sbom/ollama-0.40.19.cdx.json
# on werk1
trivy --version

Expected: Version: 0.77.0 – you installed Trivy on Day 2.

Introduction

The parts list tells you which parts are built in. Today you lay it next to the defect notices of all suppliers and ask: which of my parts have known design defects? The result will shock you – several hundred findings for a program with just over 80 lines of its own. This is exactly where many teams fail: they see the number, switch off, and the report disappears into a folder.

You take a different approach. You learn to read and sort the findings: how severe is the defect, how likely is an attack, is it already being exploited, is there a fix – and does it affect your product at all? At the end there is no number, but a list of decisions that you work through over the next days. Along the way you will notice that two scanners deliver very different numbers, and you will find out why.

Today you will learn:

  • to install Grype and understand its vulnerability database,
  • to scan a parts list and count the result with jq by severity, package type and fix status,
  • to read a CVSS vector and understand why the same vulnerability can have three different scores,
  • to query EPSS and CISA’s KEV catalog at the source,
  • why a scanner can miss vulnerabilities when given another tool’s parts list,
  • to sort findings into groups and record a decision for each group in Git.

Background

The picture of the day: the suppliers’ defect notices

Every supplier publishes defect notices: “Brake caliper type B, 2024 series, may stick in frost.” The car factory matches these notices against its parts list. Not every notice is a recall: maybe the caliper only sticks in a model that is never sold in cold regions. Maybe the factory has already swapped it for an improved one. And some notices are urgent because there have already been accidents.

  • Defect notice = CVE (Common Vulnerabilities and Exposures) or GHSA (GitHub Security Advisory).
  • How severe the defect is = CVSS – a score from 0 to 10 from a fixed formula.
  • How likely an accident is in the next 30 days = EPSS (Exploit Prediction Scoring System).
  • “There have already been accidents” list = KEV (Known Exploited Vulnerabilities) of the US agency CISA.
  • Matching against the parts list = scanner (Grype, Trivy).
  • Notice hits a similar but different part = false positive.
  • Workshop log = your assessment file with one decision per group.

The terms

Term Meaning In the picture
CVE worldwide unique number of a vulnerability number of the defect notice
GHSA advisory in the GitHub database, often linked to a CVE notice in the trade journal
CVSS severity 0–10 from a vector (attack path, effort, consequences) severity of the defect
EPSS probability of exploitation in the next 30 days, with percentile likelihood of an accident
KEV CISA catalog of vulnerabilities known to be exploited “there have already been accidents”
fix status is there a corrected version? (fixed, not-fixed, wont-fix) is there a replacement part?
false positive finding that does not affect the product notice about a different part
source package Debian package from which several binary packages are built (openssl → libssl3t64) assembly from which several parts come

Remember: A defect notice is not a recall. Only severity, likelihood, exploitation and whether you are affected, taken together, result in a decision.

What the law requires

Annex I, Part I, point 2(a) CRA requires that products “be made available on the market without known exploitable vulnerabilities”. The word exploitable matters: not every known vulnerability in a part is exploitable in your product. But that is exactly what you must be able to justify.

Annex I, Part II also requires that manufacturers shall

  1. in relation to the risks posed to products with digital elements, address and remediate vulnerabilities without delay, including by providing security updates; […]

  2. apply effective and regular tests and reviews of the security of the product with digital elements;

“In relation to the risks” means: you may prioritise. “Regular” means: a one-off scan is not enough – the databases change every day, your parts list does not.

Drill 1: Grype and its database

Where you are: on werk1.

What you have afterwards: Grype 0.122.1 and an up-to-date vulnerability database.

Grype comes from the same maker as Syft and reads its parts lists most accurately. You know the installation from Day 2.

Step 1 – download, verify, install.

# on werk1
cd ~/werkzeuge
# on werk1
curl -sSLO https://github.com/anchore/grype/releases/download/v0.122.1/grype_0.122.1_linux_amd64.tar.gz
# on werk1
curl -sSLO https://github.com/anchore/grype/releases/download/v0.122.1/grype_0.122.1_checksums.txt
# on werk1
sha256sum --check --ignore-missing grype_0.122.1_checksums.txt

Expected:

grype_0.122.1_linux_amd64.tar.gz: OK
# on werk1
tar -xzf grype_0.122.1_linux_amd64.tar.gz grype
# on werk1
sudo install -m 0755 ~/werkzeuge/grype /usr/local/bin/grype
# on werk1
grype version

Expected (excerpt):

Application:         grype
Version:             0.122.1

Step 2 – load the database. Grype does not match online but against a database on your disk. It combines advisories from many sources: NVD, GitHub, Debian, Ubuntu, Red Hat and others.

# on werk1
grype db update

Expected:

Vulnerability database updated to latest version!
# on werk1
grype db status

Expected (the From line is shortened):

Path:      /home/ubuntu/.cache/grype/db/6/vulnerability.db
Schema:    v6.1.10
Built:     2026-12-03T06:27:31Z
From:      https://grype.anchore.io/databases/v6/vulnerability-db_v6.1.10_2026-12-03T00:28:24Z_…
Status:    valid

What you see: Built is the state of the database. Every scan is valid only for this state – a vulnerability published tomorrow is unknown to it today. That is why the date belongs in every report.

Remember: A scan is a snapshot: today’s parts list against today’s defect notices. Without the date of the database, the result is worthless.

Save your progress? Sign up for free

Drill 2: The first scan

Where you are: on werk1.

What you have afterwards: all findings for the Bewerbungslotse as a table and as a JSON file, counted by severity, package type and fix status.

Step 1 – scan the parts list. Grype can take an image apart itself, but you already have the parts list. With sbom:, Grype reads it directly – faster, and you scan exactly what you have documented.

# on werk1
cd ~/lotse/sbom
# on werk1
grype sbom:bewerbungslotse-1.0.0.cdx.json

Expected (excerpt – the first lines of 266):

NAME                     INSTALLED                          FIXED IN                       TYPE    VULNERABILITY        SEVERITY    EPSS          RISK
urllib3                  2.2.1                              2.6.3                          python  GHSA-38jv-5279-wg99  High        2.9% (87th)   2.3
idna                     3.6                                3.7                            python  GHSA-jjg7-2v4v-x38h  Medium      1.4% (73rd)   0.8
python                   3.12.16                            3.16.0                         binary  CVE-2026-107784      Medium      1.2% (69th)   0.7
werkzeug                 3.0.3                              3.0.6                          python  GHSA-q34m-jh98-gwm2  Medium      1.1% (66th)   0.7
urllib3                  2.2.1                              2.6.0                          python  GHSA-2xpw-w6gg-jr37  High        0.7% (55th)   0.6
urllib3                  2.2.1                              2.6.0                          python  GHSA-gm62-xv2j-4w53  High        0.7% (55th)   0.6
urllib3                  2.2.1                              2.2.2                          python  GHSA-34jh-p97f-mpxf  Medium      1.1% (67th)   0.5
requests                 2.31.0                             2.32.4                         python  GHSA-9hjg-9r4m-mvj7  Medium      1.0% (64th)   0.5
libssl3t64               3.5.9-1~deb13u1                    (won't fix)                    deb     CVE-2026-124709      High        0.6% (52nd)   0.5
openssl                  3.5.9-1~deb13u1                    (won't fix)                    deb     CVE-2026-124709      High        0.6% (52nd)   0.5

What you see:

Column Example Meaning
INSTALLED 2.2.1 installed version
FIXED IN 2.6.3 / (won't fix) first corrected version; “won’t fix”: the package maintainer (here Debian) will not fix it
VULNERABILITY GHSA-38jv-… number of the advisory
SEVERITY High severity according to the source Grype prefers
EPSS 2.9% (87th) probability of exploitation in 30 days; worse than 87 % of all vulnerabilities
RISK 2.3 Grype’s combined score from severity and EPSS; the table is sorted by it

The table is sorted by RISK, not by severity. At the very top is a vulnerability in urllib3 that is “only” High but has the highest EPSS.

Step 2 – the same as a file. To count and filter, you need JSON:

# on werk1
mkdir -p ~/lotse/scans
# on werk1
grype sbom:bewerbungslotse-1.0.0.cdx.json -o json --file ~/lotse/scans/grype-1.0.0.json
  • -o json outputs the result as JSON.
  • --file <file> writes it to a file instead of the screen.

Step 3 – count. Each finding is an entry in .matches:

# on werk1
jq '.matches | length' ~/lotse/scans/grype-1.0.0.json

Expected:

266

By severity:

# on werk1
jq '.matches | group_by(.vulnerability.severity) | map({schwere: .[0].vulnerability.severity, anzahl: length})' ~/lotse/scans/grype-1.0.0.json

Expected:

[
  {
    "schwere": "Critical",
    "anzahl": 1
  },
  {
    "schwere": "High",
    "anzahl": 88
  },
  {
    "schwere": "Low",
    "anzahl": 16
  },
  {
    "schwere": "Medium",
    "anzahl": 102
  },
  {
    "schwere": "Negligible",
    "anzahl": 55
  },
  {
    "schwere": "Unknown",
    "anzahl": 4
  }
]

By package type:

# on werk1
jq '.matches | group_by(.artifact.type) | map({art: .[0].artifact.type, anzahl: length})' ~/lotse/scans/grype-1.0.0.json

Expected:

[
  {
    "art": "binary",
    "anzahl": 14
  },
  {
    "art": "deb",
    "anzahl": 220
  },
  {
    "art": "python",
    "anzahl": 32
  }
]

By fix status:

# on werk1
jq '.matches | group_by(.vulnerability.fix.state) | map({korrektur: .[0].vulnerability.fix.state, anzahl: length})' ~/lotse/scans/grype-1.0.0.json

Expected:

[
  {
    "korrektur": "fixed",
    "anzahl": 49
  },
  {
    "korrektur": "not-fixed",
    "anzahl": 53
  },
  {
    "korrektur": "wont-fix",
    "anzahl": 164
  }
]

What you see: 220 of the 266 findings are in Debian packages, and Debian will not fix 164 of them. That usually means: the Debian security team has assessed the vulnerability and considers it so minor or so unlikely to be exploitable that it does not ship a security update. Only 49 findings have a better version at all – almost all of them in the Python parts.

Remember: The big number almost always comes from the base image. Count by package type and fix status before you panic: where there is no replacement part, you cannot swap it.

Save your progress? Sign up for free

Drill 3: Reading a finding – CVSS

Where you are: on werk1.

What you have afterwards: read a vulnerability in detail, decoded its CVSS vector and seen why different sources give different scores.

The table lists GHSA-q34m-jh98-gwm2 with Medium for Werkzeug. You take a closer look, because Werkzeug is the foundation of Flask – and therefore of every request to your Lotse.

Step 1 – what is it about? relatedVulnerabilities links the GHSA to its CVE number:

# on werk1
jq '.matches[] | select(.vulnerability.id == "GHSA-q34m-jh98-gwm2") | {paket: .artifact.name, version: .artifact.version, gefunden_ueber: .matchDetails[0].type, suche: .matchDetails[0].searchedBy, korrektur: .vulnerability.fix.versions}' ~/lotse/scans/grype-1.0.0.json

Expected:

{
  "paket": "werkzeug",
  "version": "3.0.3",
  "gefunden_ueber": "exact-direct-match",
  "suche": {
    "language": "python",
    "namespace": "github:language:python",
    "package": {
      "name": "werkzeug",
      "version": "3.0.3"
    }
  },
  "korrektur": [
    "3.0.6"
  ]
}

What you see: Grype found the finding through an exact match (exact-direct-match): package werkzeug in version 3.0.3 is listed as affected in the GitHub database for Python. No guessing. The fix came with 3.0.6. The advisory is CVE-2024-49767: “Werkzeug possible resource exhaustion when parsing file data in forms” – exhausting memory while reading files from forms.

Step 2 – three sources, three scores. Trivy shows the CVSS scores of all sources side by side. So you also scan the parts list with Trivy:

# on werk1
trivy sbom --format json --output ~/lotse/scans/trivy-1.0.0.json bewerbungslotse-1.0.0.cdx.json
Option Meaning
sbom scan a parts list instead of an image
--format json output as JSON
--output <file> into this file
bewerbungslotse-1.0.0.cdx.json the parts list from Syft

On the first run Trivy downloads its database (just over 140 MB, 28 seconds in my lab).

Expected (excerpt – without progress bars, leading timestamps removed):

INFO    [vulndb] Artifact successfully downloaded   repo="mirror.gcr.io/aquasec/trivy-db:2"
INFO    [vuln] Vulnerability scanning is enabled
INFO    Detected SBOM format    format="cyclonedx-json"
WARN    Third-party SBOM may lead to inaccurate vulnerability detection
WARN    Recommend using Trivy to generate SBOMs
INFO    Detected OS family="debian" version="13.8"
INFO    [debian] Detecting vulnerabilities...   os_version="13" pkg_num=87
INFO    Number of language-specific files   num=1
INFO    [python-pkg] Detecting vulnerabilities...
WARN    Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.77/guide/scanner/vulnerability#severity-selection for details.

Note the warning “Third-party SBOM may lead to inaccurate vulnerability detection” – it becomes important in the diagnosis task. Now the Werkzeug vulnerability:

# on werk1
jq '[.Results[].Vulnerabilities[]? | select(.VulnerabilityID == "CVE-2024-49767")] | .[0] | {VulnerabilityID, PkgName, InstalledVersion, FixedVersion, Severity, SeveritySource, cvss: .CVSS}' ~/lotse/scans/trivy-1.0.0.json

[]? means: if a result has no Vulnerabilities, skip it instead of aborting.

Expected:

{
  "VulnerabilityID": "CVE-2024-49767",
  "PkgName": "werkzeug",
  "InstalledVersion": "3.0.3",
  "FixedVersion": "3.0.6",
  "Severity": "MEDIUM",
  "SeveritySource": "ghsa",
  "cvss": {
    "ghsa": {
      "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "V40Vector": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
      "V3Score": 7.5,
      "V40Score": 6.9
    },
    "nvd": {
      "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "V3Score": 7.5
    },
    "redhat": {
      "V3Vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
      "V3Score": 5.3
    }
  }
}

Step 3 – read the vector. The NVD’s CVSS 3.1 vector, broken down:

Part Value Meaning
AV:N Network attack possible over the network
AC:L Low no special conditions needed
PR:N None no login needed
UI:N None no victim has to click along
S:U Unchanged the consequences stay within the affected component
C:N / I:N None no data read or changed
A:H High availability severely impaired – the service stops

What you see: NVD and GitHub, using CVSS 3.1, rate the outage as severe (A:H, 7.5 = High). Red Hat rates it as low (A:L, 5.3 = Medium). GitHub, using CVSS 4.0, gives only 6.9 = Medium, and this is exactly the score Grype and Trivy use as Severity. So the same vulnerability is “High” or “Medium”, depending on whom you ask.

For you, something else matters: the vector says “over the network, without login, while reading form data”. Your Lotse accepts attachments via POST /api/bewerbungen/<nummer>/anlagen as form data – over a NodePort, without login. This vulnerability affects you.

Remember: The CVSS score is an opinion, the vector is the description. Read the vector and compare it with your product: where does the attacker strike, and can they reach that point in your product?

Save your progress? Sign up for free

Drill 4: Is it being exploited? EPSS and KEV

Where you are: on werk1.

What you have afterwards: queried CISA’s KEV catalog and EPSS scores from FIRST directly at the source and checked them against your findings.

CVSS says how bad a defect would be. Whether anyone exploits it is told by two other sources. Grype already has EPSS built in, but you want to know where the numbers come from – and do the KEV match yourself. The downloaded files are course material, not part of the product; they go into a folder of their own.

Step 1 – a folder for the day.

# on werk1
mkdir -p ~/kurs/03
# on werk1
cd ~/kurs/03

Step 2 – the KEV catalog. CISA publishes it as a JSON file:

# on werk1
curl -sSL -o kev.json https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
# on werk1
jq '{catalogVersion, dateReleased, count}' kev.json

Expected (newer in your lab):

{
  "catalogVersion": "2026.11.30",
  "dateReleased": "2026-11-30T19:44:39.2733Z",
  "count": 1810
}

A famous example shows what an entry looks like – Heartbleed, the OpenSSL vulnerability from 2014:

# on werk1
jq '.vulnerabilities[] | select(.cveID == "CVE-2014-0160") | {cveID, vendorProject, product, vulnerabilityName, dateAdded}' kev.json

Expected:

{
  "cveID": "CVE-2014-0160",
  "vendorProject": "OpenSSL",
  "product": "OpenSSL",
  "vulnerabilityName": "OpenSSL Information Disclosure Vulnerability",
  "dateAdded": "2022-05-04"
}

Step 3 – is one of your vulnerabilities in the catalog? You need both files in one jq call. --slurpfile reads a file into a variable:

# on werk1
jq -n --slurpfile kev kev.json --slurpfile scan ~/lotse/scans/grype-1.0.0.json '[$scan[0].matches[] | (.vulnerability.id, .relatedVulnerabilities[].id)] | unique as $ids | [$kev[0].vulnerabilities[] | select(.cveID | IN($ids[])) | {cveID, product, dateAdded}]'
Part Meaning
-n read no input; all data comes from the variables
--slurpfile kev kev.json load the catalog into the variable $kev (as a list with one element)
--slurpfile scan … load the Grype result into $scan
(.vulnerability.id, .relatedVulnerabilities[].id) from each finding, its own number and the linked CVE numbers
unique as $ids remove duplicates and keep them as $ids
select(.cveID \| IN($ids[])) only catalog entries whose CVE appears in $ids

The single quotes around the expression are important: they prevent the shell from replacing $scan, $ids and $kev as its own variables.

Expected:

[]

What you see: an empty list. But does that mean “nothing found” or “expression broken”? You always check an empty answer with a counter-test. You give the expression a list that contains a vulnerability that is certainly in the catalog:

# on werk1
jq -n --slurpfile kev kev.json '["CVE-2014-0160", "CVE-2024-49767"] as $ids | [$kev[0].vulnerabilities[] | select(.cveID | IN($ids[])) | .cveID]'

Expected:

[
  "CVE-2014-0160"
]

Heartbleed is found, the Werkzeug vulnerability is not. The expression works – none of the vulnerabilities in the Bewerbungslotse is in the KEV catalog.

Step 4 – EPSS at the source. FIRST, the organisation behind EPSS, offers an open API. You query three vulnerabilities: the one with the highest EPSS from the table (urllib3), your Werkzeug vulnerability and, for comparison, Heartbleed:

# on werk1
curl -sS -o epss.json "https://api.first.org/data/v1/epss?cve=CVE-2026-21441,CVE-2024-49767,CVE-2014-0160"
  • -o epss.json saves the response to a file.
  • The quotes around the address prevent the shell from interpreting the ? as a wildcard for file names.
# on werk1
jq '.data' epss.json

Expected (in your lab a newer date and different values):

[
  {
    "cve": "CVE-2026-21441",
    "epss": "0.029220000",
    "percentile": "0.874280000",
    "date": "2026-12-02"
  },
  {
    "cve": "CVE-2024-49767",
    "epss": "0.010950000",
    "percentile": "0.665060000",
    "date": "2026-12-02"
  },
  {
    "cve": "CVE-2014-0160",
    "epss": "0.999990000",
    "percentile": "0.999970000",
    "date": "2026-12-02"
  }
]

What you see:

CVE EPSS Percentile Reading
CVE-2026-21441 (urllib3) 2.9 % 87 % higher than for 87 % of all vulnerabilities – but low in absolute terms
CVE-2024-49767 (Werkzeug) 1.1 % 67 % middle of the field
CVE-2014-0160 (Heartbleed) 99.999 % 99.997 % is practically certain to be exploited

EPSS is recalculated every day. Today’s values will be different tomorrow.

Remember: KEV is a fact (“has been exploited”), EPSS is a prediction (“will probably be exploited”). If a vulnerability is in KEV, you drop everything else.

Save your progress? Sign up for free

Drill 5: The second scanner – and a trap

Where you are: on werk1.

What you have afterwards: counted Trivy’s findings and compared them with Grype.

Trivy’s result has been in ~/lotse/scans/trivy-1.0.0.json since Drill 3.

Step 1 – count.

# on werk1
jq '[.Results[].Vulnerabilities[]?] | length' ~/lotse/scans/trivy-1.0.0.json

Expected:

68
# on werk1
jq '.Results[] | {Target, Class, anzahl: (.Vulnerabilities // [] | length)}' ~/lotse/scans/trivy-1.0.0.json

// [] inserts an empty list if a result has no findings.

Expected:

{
  "Target": "bewerbungslotse-1.0.0.cdx.json (debian 13.8)",
  "Class": "os-pkgs",
  "anzahl": 36
}
{
  "Target": "Python",
  "Class": "lang-pkgs",
  "anzahl": 32
}
# on werk1
jq '[.Results[].Vulnerabilities[]?] | group_by(.Severity) | map({schwere: .[0].Severity, anzahl: length})' ~/lotse/scans/trivy-1.0.0.json

Expected:

[
  {
    "schwere": "CRITICAL",
    "anzahl": 1
  },
  {
    "schwere": "HIGH",
    "anzahl": 12
  },
  {
    "schwere": "LOW",
    "anzahl": 21
  },
  {
    "schwere": "MEDIUM",
    "anzahl": 33
  },
  {
    "schwere": "UNKNOWN",
    "anzahl": 1
  }
]

What you see:

Grype Trivy (with Syft parts list)
Python packages 32 32
Debian packages 220 36
Python interpreter 14 –
High + Critical 89 13

For Python, both agree. For Debian, they are six times apart. Two databases, two ways of counting – or a measurement error? You clear that up in the diagnosis task. Trivy does not check the Python interpreter because it is not in any package manager (see Day 2).

Remember: Two scanners are not two opinions on the same question as long as you don’t know whether they were asked the same question. A big difference is a clue, not a result.

Save your progress? Sign up for free

Drill 6: Recognising false positives

Where you are: on werk1.

What you have afterwards: seen how a scanner finds matches, and identified two groups that do not affect your product, or only maybe.

Step 1 – how were the findings found?

# on werk1
jq '.matches | group_by(.matchDetails[0].type) | map({art: .[0].matchDetails[0].type, anzahl: length})' ~/lotse/scans/grype-1.0.0.json

Expected:

[
  {
    "art": "cpe-match",
    "anzahl": 14
  },
  {
    "art": "exact-direct-match",
    "anzahl": 66
  },
  {
    "art": "exact-indirect-match",
    "anzahl": 186
  }
]
Type Meaning Reliability
exact-direct-match package name and version appear exactly like this in the advisory high
exact-indirect-match found via the source package: Debian reports openssl, libssl3t64 is installed high
cpe-match via a guessed product name (CPE) from the NVD low – false positives possible

Step 2 – the CPE matches. All 14 concern the Python interpreter. An example:

# on werk1
jq '.matches[] | select(.vulnerability.id == "CVE-2025-12781") | {paket: .artifact.name, version: .artifact.version, gefunden_ueber: .matchDetails[0].type, suche: .matchDetails[0].searchedBy.cpes, korrektur: .vulnerability.fix.versions}' ~/lotse/scans/grype-1.0.0.json

Expected:

{
  "paket": "python",
  "version": "3.12.16",
  "gefunden_ueber": "cpe-match",
  "suche": [
    "cpe:2.3:a:python:python:3.12.16:*:*:*:*:*:*:*"
  ],
  "korrektur": [
    "3.13.10",
    "3.14.1",
    "3.15.0a2"
  ]
}

What you see: Fixed in 3.13.10, 3.14.1 and 3.15.0a2 – but no version of the 3.12 series. That can mean two things: the fix was not backported to 3.12, or it was already included in 3.12.16 and the NVD data does not know it. Python 3.12 only receives security fixes now, and exactly those often land in late versions such as 3.12.16. Only the maker can answer this – the Python project with its security advisories. Until then, the finding is neither confirmed nor refuted.

Step 3 – findings that only affect another operating system. Werkzeug has five advisories about safe_join. Read the descriptions of the Python findings:

# on werk1
jq -r '.matches[] | select(.artifact.name == "werkzeug") | [.vulnerability.id, .vulnerability.description] | @tsv' ~/lotse/scans/grype-1.0.0.json
  • […] | @tsv turns each list into a line with tabs.
  • -r outputs it without quotes.

Expected:

GHSA-q34m-jh98-gwm2 Werkzeug possible resource exhaustion when parsing file data in forms
GHSA-f9vj-2wh5-fj8j Werkzeug safe_join not safe on Windows
GHSA-29vq-49wr-vm6x Werkzeug safe_join() allows Windows special device names
GHSA-hgf8-39gv-g3f2 Werkzeug safe_join() allows Windows special device names
GHSA-87hc-h4r5-73f7 Werkzeug safe_join() allows Windows special device names with compound extensions
GHSA-g6x2-hccm-hh4m Werkzeug safe_join() allows Windows special device names

What you see: Five of the six Werkzeug advisories affect only Windows. Your Lotse runs in a Debian container. These five are not exploitable for your product – that is not a false positive by the scanner (the package is affected, after all), but a case of “part built in, defect does not affect this model”. That is exactly what VEX is for, tomorrow on Day 4. It is similar with Jinja2: three advisories concern Jinja’s sandbox, and your Lotse does not render any templates at all.

Remember: A CPE match is a suspicion, not a finding. And a real match in the package is not yet a vulnerability in the product – operating system, configuration and the functions used decide.

Save your progress? Sign up for free

Drill 7: The workshop log

Where you are: on werk1.

What you have afterwards: an assessment file SCHWACHSTELLEN.md with one decision per group, versioned together with the scan results.

Nobody manages to assess 266 findings one by one. You form groups and make one decision per group. For the minimum versions of the Python packages you need today’s challenge – the results are already in the file.

Step 1 – the file.

# on werk1
nano ~/lotse/SCHWACHSTELLEN.md
~/lotse/SCHWACHSTELLEN.md new file
# Schwachstellen Bewerbungslotse 1.0.0

Stand: 2026-12-03 · Scanner: Grype 0.122.1 (Datenbank vom 2026-12-03),
Gegenprobe Trivy 0.77.0 · Grundlage: sbom/bewerbungslotse-1.0.0.cdx.json

## Überblick

- 266 Treffer (Grype): 220 Debian, 32 Python, 14 Python-Interpreter
- Im KEV-Katalog der CISA (Stand 2026.11.30): keiner
- Höchstes EPSS: CVE-2026-21441 (urllib3), 2,9 %

## Entscheidungen

| Gruppe | Treffer | Entscheidung | Wann |
|---|---|---|---|
| Python-Pakete außer pip | 26 | aktualisieren auf Mindestversion | Tag 6 |
| davon Werkzeug safe_join (nur Windows) | 5 | für 1.0.0: nicht betroffen, VEX | Tag 4 |
| davon Jinja2-Sandbox (nicht genutzt) | 3 | für 1.0.0: nicht betroffen, VEX | Tag 4 |
| pip (nur beim Bau gebraucht) | 6 | aus dem Laufzeit-Image entfernen | Tag 5 |
| Python-Interpreter (über CPE geraten) | 14 | einzeln prüfen | Tag 4 |
| Debian mit Korrektur | 3 | Neubau mit aktuellem Grundimage | Tag 6 |
| Debian ohne Korrektur | 217 | Debian-Bewertung übernehmen, Grundimage aktuell halten | laufend |

## Betrifft uns sicher

- CVE-2024-49767 (Werkzeug 3.0.3, Speicher erschöpfen beim Lesen von
  Formulardaten): app.py nimmt Anlagen über request.files an –
  erreichbar über POST /api/bewerbungen/<nummer>/anlagen

## Mindestversionen (Python)

| Paket | ist | mindestens |
|---|---|---|
| certifi | 2024.2.2 | 2026.10.18 |
| flask | 3.0.3 | 3.1.3 |
| idna | 3.6 | 3.15 |
| jinja2 | 3.1.4 | 3.1.6 |
| requests | 2.31.0 | 2.33.0 |
| urllib3 | 2.2.1 | 2.8.0 |
| werkzeug | 3.0.3 | 3.1.9 |

The groups add up to 266: 26 + 6 + 14 + 3 + 217. The two “davon” (of which) lines are part of the 26. Why the VEX groups still matter even though you update the packages anyway: your customers run version 1.0.0 today. They scan it themselves, see the same 266 findings and ask you. VEX is your answer for the version that is out there.

Step 2 – commit.

# on werk1
cd ~/lotse
# on werk1
git status --short

Expected:

?? SCHWACHSTELLEN.md
?? scans/
# on werk1
git add SCHWACHSTELLEN.md scans
# on werk1
git commit -m "Schwachstellenbewertung 1.0.0 mit Scan-Ergebnissen"

Expected:

[main 30a5c46] Schwachstellenbewertung 1.0.0 mit Scan-Ergebnissen
 4 files changed, 31850 insertions(+)
 create mode 100644 SCHWACHSTELLEN.md
 create mode 100644 scans/grype-1.0.0.json
 create mode 100644 scans/trivy-1.0.0.json
 create mode 100644 scans/trivy-image-1.0.0.json

The file trivy-image-1.0.0.json is created in the diagnosis task. If you do the drills in this order, it is still missing here – then git commit shows three files.

Remember: The workshop log turns 266 findings into seven decisions. It carries the date and the database state and sits next to the raw data so that anyone can verify the decision.

Save your progress? Sign up for free

Diagnosis task

The numbers from Drill 5 won’t leave you alone: Grype finds 220 findings in Debian packages, Trivy with the same parts list only 36. Trivy printed a warning: “Third-party SBOM may lead to inaccurate vulnerability detection”. Find out whether Trivy really knows fewer vulnerabilities or whether the measurement is wrong.

Solution path:

  1. Let Trivy read the image itself, without Syft’s parts list:

    # on werk1
    trivy image --image-src remote --insecure --no-progress --format json --output ~/lotse/scans/trivy-image-1.0.0.json werk1:5000/bewerbungslotse:1.0.0

    --no-progress switches off the progress bar.

    # on werk1
    jq '.Results[] | {Target, Class, anzahl: (.Vulnerabilities // [] | length)}' ~/lotse/scans/trivy-image-1.0.0.json

    Expected:

    {
      "Target": "werk1:5000/bewerbungslotse:1.0.0 (debian 13.8)",
      "Class": "os-pkgs",
      "anzahl": 232
    }
    {
      "Target": "Python",
      "Class": "lang-pkgs",
      "anzahl": 32
    }

    232 instead of 36. Trivy knows the vulnerabilities – it just didn’t find them with Syft’s parts list.

  2. Check a single package. libssl3t64 is a binary package from the Debian source package openssl:

    # on werk1
    jq '[.Results[0].Vulnerabilities[] | select(.PkgName == "libssl3t64")] | length' ~/lotse/scans/trivy-1.0.0.json

    Expected: 0

    # on werk1
    jq '[.Results[0].Vulnerabilities[] | select(.PkgName == "libssl3t64")] | length' ~/lotse/scans/trivy-image-1.0.0.json

    Expected: 15

  3. Compare how the two parts lists name the source package. In Syft’s:

    # on werk1
    jq '.components[] | select(.name == "libssl3t64") | {name, version, purl, quelle: [.properties[] | select(.name | test("source"; "i"))]}' ~/lotse/sbom/bewerbungslotse-1.0.0.cdx.json

    test("source"; "i") searches for source regardless of upper and lower case.

    Expected:

    {
      "name": "libssl3t64",
      "version": "3.5.9-1~deb13u1",
      "purl": "pkg:deb/debian/[email protected]~deb13u1?arch=amd64&distro=debian-13.8&upstream=openssl",
      "quelle": [
        {
          "name": "syft:metadata:source",
          "value": "openssl"
        }
      ]
    }

    In Trivy’s (the parts list from Day 2):

    # on werk1
    jq '.components[] | select(.name == "libssl3t64") | {name, version, purl, quelle: [.properties[] | select(.name | test("Src"))]}' ~/trivy-1.0.0.cdx.json

    Expected:

    {
      "name": "libssl3t64",
      "version": "3.5.9-1~deb13u1",
      "purl": "pkg:deb/debian/[email protected]~deb13u1?arch=amd64&distro=debian-13.8",
      "quelle": [
        {
          "name": "aquasecurity:trivy:SrcName",
          "value": "openssl"
        },
        {
          "name": "aquasecurity:trivy:SrcRelease",
          "value": "1~deb13u1"
        },
        {
          "name": "aquasecurity:trivy:SrcVersion",
          "value": "3.5.9"
        }
      ]
    }
  4. The cause: Debian publishes its security advisories per source package (openssl), not per binary package (libssl3t64). Both parts lists know the source package but write it in different places: Syft in the upstream=openssl qualifier of the purl and in syft:metadata:source, Trivy in its own fields aquasecurity:trivy:SrcName. In a third-party parts list Trivy reads only its own fields, finds no source package and compares only against the name libssl3t64 – under which Debian reports nothing.

The lesson: parts list and scanner must fit together. Syft with Grype, Trivy with Trivy – or you check with a spot test like this one whether a mixed pair finds everything. A small number is only good news if the measurement is right.

Challenge

For the update on Day 6 you need, for each Python package, the minimum version that fixes all findings – that is, the highest of the “FIXED IN” versions. Write a jq expression that outputs, for each Python package, the name, the installed version and this minimum version. Check your result for idna against the table from Drill 2.

Solution: The obvious expression uses max:

# on werk1
jq '[.matches[] | select(.artifact.type == "python")] | group_by(.artifact.name) | map({paket: .[0].artifact.name, ist: .[0].artifact.version, mindestens: (map(.vulnerability.fix.versions[0]) | max)})' ~/lotse/scans/grype-1.0.0.json

Expected (excerpt):

  {
    "paket": "idna",
    "ist": "3.6",
    "mindestens": "3.7"
  },

That is wrong. In the table from Drill 2, idna has a fix in 3.15 as well as 3.7. max compares strings character by character, and "3.7" is greater than "3.15" as a string because 7 is greater than 1. Versions must be compared as sequences of numbers:

# on werk1
jq '[.matches[] | select(.artifact.type == "python")] | group_by(.artifact.name) | map({paket: .[0].artifact.name, ist: .[0].artifact.version, mindestens: (map(.vulnerability.fix.versions[0]) | max_by(split(".") | map(tonumber)))})' ~/lotse/scans/grype-1.0.0.json

max_by(split(".") | map(tonumber)) splits each version at the dots, turns each part into a number and then compares [3,7] with [3,15] – correctly.

Expected:

[
  {
    "paket": "certifi",
    "ist": "2024.2.2",
    "mindestens": "2026.10.18"
  },
  {
    "paket": "flask",
    "ist": "3.0.3",
    "mindestens": "3.1.3"
  },
  {
    "paket": "idna",
    "ist": "3.6",
    "mindestens": "3.15"
  },
  {
    "paket": "jinja2",
    "ist": "3.1.4",
    "mindestens": "3.1.6"
  },
  {
    "paket": "pip",
    "ist": "25.0.1",
    "mindestens": "26.2.0"
  },
  {
    "paket": "requests",
    "ist": "2.31.0",
    "mindestens": "2.33.0"
  },
  {
    "paket": "urllib3",
    "ist": "2.2.1",
    "mindestens": "2.8.0"
  },
  {
    "paket": "werkzeug",
    "ist": "3.0.3",
    "mindestens": "3.1.9"
  }
]

The trick works here because all versions consist only of numbers. For versions like 3.15.0a2, tonumber would fail – for such cases, in practice you use a tool that knows the versioning rules.

Save your progress? Sign up for free

Checkpoint

# on werk1
grype version

Expected (excerpt): Version: 0.122.1

# on werk1
git -C ~/lotse log --oneline --decorate

Expected (your commit IDs differ):

30a5c46 (HEAD -> main) Schwachstellenbewertung 1.0.0 mit Scan-Ergebnissen
8992076 Stücklisten für 1.0.0 (CycloneDX, SPDX) und Ollama
64fd9fd (tag: v1.0.0) Bewerbungslotse 1.0.0 mit Produktsteckbrief
# on werk1
git -C ~/lotse ls-files scans SCHWACHSTELLEN.md

Expected:

SCHWACHSTELLEN.md
scans/grype-1.0.0.json
scans/trivy-1.0.0.json
scans/trivy-image-1.0.0.json

Test yourself

  1. What distinguishes CVSS, EPSS and KEV, and which of the three is a fact?
  2. The same Werkzeug vulnerability is 7.5 (High) at NVD and Medium in Grype. How can that be, and what do you read instead?
  3. Why did Trivy find only 36 Debian vulnerabilities with Syft’s parts list, but 232 with the image?
  4. What does cpe-match mean for a finding, and how do you deal with it?
  5. Five Werkzeug advisories concern safe_join on Windows. Are they false positives?
  6. Why is a single scan not enough to meet Annex I, Part II CRA?

Answers:

  1. CVSS rates severity from a vector, EPSS predicts the probability of exploitation within 30 days, KEV lists vulnerabilities known to have been exploited. Only KEV is a fact.
  2. Different sources rate differently (NVD and GitHub with CVSS 3.1: 7.5, Red Hat: 5.3), and here the scanners take GitHub’s CVSS 4.0 score (6.9 = Medium). You read the vector – network, no login, outage – and check whether the attacked point is reachable in your product.
  3. Debian reports vulnerabilities per source package. Syft writes the source package in places that Trivy does not read in third-party parts lists; Trivy therefore compared only binary package names. With the image, Trivy reads the source packages itself.
  4. The finding was found via a guessed NVD product name, not via an exact package match. It is a suspicion: you check it with the maker of the component before you record it as affected or not affected.
  5. No – the package in this version is affected, the scanner is right. But your product runs on Linux, where the vulnerability is not exploitable. That is a case for VEX: “not affected, because …”.
  6. The databases change every day, your product’s parts list does not. Annex I, Part II, point 3 requires regular tests of security; you only find new advisories about known parts through repeated scans.

Interview note

“Your scanner reports 300 vulnerabilities. What now?” – Good answer: first check whether the measurement is right (parts list and scanner fit together, database up to date). Then group: by package type, fix status, KEV and EPSS. KEV entries immediately, bundle fixes with reasonable effort, exclude non-exploitable findings with a justification via VEX, leave the rest to the base image update. If they dig deeper: CVSS is an opinion, the vector is the description – and the decision comes from comparing the vector with your own product, not from the colour in the table.

Enterprise note

In practice the scan runs in the CI pipeline on every build and additionally every day against the parts lists of all shipped versions – because new vulnerabilities appear in old versions. Platforms such as Dependency-Track take over the continuous rescanning, collect the assessments and send alerts when a vulnerability moves into the KEV catalog. Many companies set a policy, for example: KEV within 72 hours, Critical with a fix within 14 days, the rest in the next release. Important for the CRA: the policy alone is not evidence – the workshop log with date and justification is.

Summary

  • Grype 0.122.1 with the database of 3 December 2026 finds 266 findings: 220 Debian, 32 Python, 14 in the Python interpreter. Only 49 have a fix; Debian will not fix 164.
  • CVSS scores differ by source; the vector describes the vulnerability. CVE-2024-49767 in Werkzeug is reachable through your attachment upload.
  • No vulnerability is in the KEV catalog; the highest EPSS is CVE-2026-21441 in urllib3 with 2.9 %.
  • Trivy with Syft’s parts list found only 36 Debian findings, with the image 232: it did not read the source package in the third-party parts list.
  • 14 findings in the Python interpreter came via guessed CPEs; eight findings in Werkzeug and Jinja2 are not exploitable for your product.
  • SCHWACHSTELLEN.md records seven decisions and the minimum versions, together with the raw data in Git.

Commands at a glance

Command Purpose
grype db update / grype db status load the database, show its state
grype sbom:<file> scan a parts list, table
grype sbom:<file> -o json --file <target> result as a JSON file
jq '.matches \| group_by(.vulnerability.severity) \| …' count findings by severity
trivy sbom --format json --output <target> <parts-list> scan a parts list with Trivy
trivy image --image-src remote --insecure --no-progress --format json --output <target> <image> scan an image with Trivy
curl -sSL -o kev.json https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json download the KEV catalog
jq -n --slurpfile a <file> --slurpfile b <file> '…' two JSON files in one expression
curl -sS -o epss.json "https://api.first.org/data/v1/epss?cve=<CVE>,<CVE>" query EPSS scores
jq '… \| max_by(split(".") \| map(tonumber))' determine the highest version correctly

Contents

More