Vulnerability management

How to Prioritize Container Vulnerabilities with EPSS and KEV

CVSS says how bad a vulnerability would be; EPSS and CISA KEV say whether anyone is exploiting it. How to join all three into one container fix order.

TrustIvan ·

A container image scan hands you a list sorted by CVSS severity, and the list is usually too long to fix in one sprint. Prioritizing container vulnerabilities with EPSS and KEV means asking a second question of every row: is anyone actually exploiting this, or likely to? CVSS cannot answer that. It was never designed to. This guide shows what each signal measures, how to pull both feeds yourself with curl and a short script, and where the method stops being reliable.

What do CVSS, EPSS and KEV each measure?

They answer three different questions, and most bad prioritization comes from treating one as if it answered another.

SignalQuestion it answersPublished byChanges
CVSS base scoreHow much damage could this do if exploited?The CNA or NVD, per CVERarely, on re-rating
EPSSHow likely is exploitation in the next 30 days?FIRSTDaily
KEVHas this been exploited in the wild?CISAWhen CISA adds an entry

CVSS is a severity score. A 9.8 tells you the vulnerability is network reachable, needs no privileges and gives full compromise. It says nothing about whether exploit code exists, whether anyone is using it, or whether your image runs the vulnerable code at all.

EPSS (the Exploit Prediction Scoring System) is a model maintained by a FIRST special interest group. For every published CVE it outputs a probability between 0 and 1 that exploitation activity will be observed in the next 30 days, plus a percentile that ranks that probability against every other scored CVE. It is a forecast, refreshed daily.

The CISA Known Exploited Vulnerabilities catalog is a list of CVEs with reliable evidence of exploitation. It is not a forecast. An entry means somebody has already used it against a real system.

Why is CVSS alone a poor fix order?

Because severity and likelihood are independent. A critical in a library function your service never calls ranks above a high in an internet-facing SSH daemon that attackers are actively scanning for. Teams that sort by CVSS spend their first week on the critical and leave the high for later.

There is also a volume problem. A typical base image carries dozens of findings rated high or critical, and the number does not shrink much when you change distribution. If every high is urgent, none of them is, and the engineers asked to fix them learn to stop reading the report.

EPSS and KEV do not replace CVSS. They reorder it. Severity still tells you how bad the outcome is; the threat signals tell you which outcomes are on their way.

How do you get the data?

You need three files: the scan, the KEV catalog and EPSS scores for the CVEs in the scan.

Scan the image with any engine that emits JSON. With Trivy:

trivy image --scanners vuln --format json --output scan.json \
  registry.example.com/payments-api:1.42.0

Download the KEV catalog. CISA publishes it as JSON under CC0, so there is no license question to settle before you automate it:

curl -s -o kev.json \
  https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
jq -r '.catalogVersion, .count' kev.json

Each entry carries cveID, dateAdded, dueDate, requiredAction and knownRansomwareCampaignUse. The last field is worth surfacing in your report: a CVE used by ransomware operators belongs at the very top.

Query EPSS for the CVEs you found. The FIRST API takes a comma-separated list:

curl -s "https://api.first.org/data/v1/epss?cve=CVE-2023-4863,CVE-2024-6387" \
  | jq '.data[] | {cve, epss, percentile, date}'

Two details trip people up. The API returns epss and percentile as strings, so convert them before comparing. And every response carries a date: record it, because a ranking made from last month's scores is a different ranking.

How do you join them into one ranked list?

The script below reads the three sources and sorts findings into tiers: known exploited first, then anything in the top five percent of EPSS scores, then everything else by EPSS and CVSS severity.

import json, urllib.request
 
scan = json.load(open("scan.json"))
kev = {v["cveID"] for v in json.load(open("kev.json"))["vulnerabilities"]}
 
rows = []
for result in scan.get("Results", []):
    for v in result.get("Vulnerabilities") or []:
        rows.append({
            "id": v["VulnerabilityID"],
            "pkg": v["PkgName"],
            "installed": v["InstalledVersion"],
            "fixed": v.get("FixedVersion", ""),
            "severity": v.get("Severity", "UNKNOWN"),
        })
 
cves = sorted({r["id"] for r in rows if r["id"].startswith("CVE-")})
epss = {}
for i in range(0, len(cves), 50):
    url = "https://api.first.org/data/v1/epss?cve=" + ",".join(cves[i:i + 50])
    with urllib.request.urlopen(url, timeout=30) as resp:
        for d in json.load(resp)["data"]:
            epss[d["cve"]] = (float(d["epss"]), float(d["percentile"]))
 
def tier(r):
    if r["id"] in kev:
        return 0                      # exploited now
    p = epss.get(r["id"])
    if p and p[1] >= 0.95:
        return 1                      # top 5% most likely to be exploited
    return 2
 
sev = {"CRITICAL": 0, "HIGH": 1, "MEDIUM": 2, "LOW": 3, "UNKNOWN": 4}
rows.sort(key=lambda r: (tier(r), -epss.get(r["id"], (0, 0))[0], sev[r["severity"]]))
 
for r in rows:
    p = epss.get(r["id"])
    print(f'{tier(r)}  {r["id"]:<18} {"KEV" if r["id"] in kev else "   "} '
          f'{f"{p[0]:.3f}" if p else "  n/a"}  {r["severity"]:<8} '
          f'{r["pkg"]} {r["installed"]} -> {r["fixed"] or "no fix"}')

The 95th-percentile cut-off is a starting point, not a standard. Tune it to the amount of work your team can absorb in a cycle: if tier 1 is consistently longer than a sprint, raise the cut-off; if it is empty for months, lower it.

Run it on a real image and the output usually looks different from the CVSS order. A high that is in KEV jumps above every unexploited critical, and a critical with a low EPSS probability and no exploitation history drops into tier 2, where it belongs.

What should the tiers mean in practice?

A ranking is only useful if each tier comes with a response time somebody has agreed to. One reasonable shape:

  • Tier 0, known exploited. Fix or mitigate on the KEV timeline or faster, and treat an image running in production as an incident if no fix exists.
  • Tier 1, high EPSS. Schedule into the current cycle. Re-check daily, because a CVE that enters KEV moves to tier 0.
  • Tier 2, everything else. Batch by base-image upgrade. Most of these disappear when you rebuild on a newer base, which is cheaper than patching them one by one.

Add two adjustments that the feeds cannot make for you. Raise anything in an image that is actually running, and lower anything that only reaches the image through a build-time or test dependency. Neither feed knows what your cluster is running. You do.

Where does this method go wrong?

Missing is not zero. A finding reported under a GitHub advisory ID (GHSA-…) with no CVE alias has no EPSS score and cannot be in KEV. The script above prints n/a for it. Do not let n/a sort as "safe": resolve the alias first, or review those rows by hand. The same goes for a KEV download that failed. An empty catalog marks your whole estate as unexploited, which is the most dangerous wrong answer available.

EPSS is about the CVE, not your deployment. It has no idea whether the vulnerable function is reachable in your build, whether the port is exposed, or whether a compensating control is in place. A high score says "attackers are likely to try this somewhere", which is a reason to look, not proof you are exposed.

KEV lags. CISA adds entries once it has reliable evidence, and that takes time. A CVE being exploited today may not be in the catalog yet, which is exactly the gap EPSS is meant to cover. Use both, never one.

Scores move. EPSS is recalculated daily and the model itself is versioned. Store the score date and model version next to every decision so that a reviewer can see what you knew at the time.

Attribution. FIRST asks that EPSS be credited when its scores are used or republished. Check the terms on the EPSS site before you put scores into a report that leaves your organization.

How does TrustIvan apply EPSS and KEV?

TrustIvan builds this ordering into every finding, with the inputs shown rather than hidden. Each finding carries a risk score from 0 to 100 and the breakdown behind it: up to 40 points from CVSS severity, up to 35 from threat (35 if the CVE is in KEV, otherwise 30 times its EPSS probability, never both), 15 if the asset graph records the image running, and 5 if a fixed version is known. The total is multiplied by 0.6 when the lockfile marks the package as a development dependency, by 0.7 when the image's own entrypoint configuration shows the process cannot load the package, and by the criticality your team set on the asset. The formula and worked examples are on the risk scoring page.

A few choices there follow from the pitfalls above. KEV and EPSS are both on by default, and every EPSS score names FIRST, the model version and the score date, which is the attribution FIRST asks for; an air-gapped deployment can load the daily file from disk or turn EPSS off. A feed that has never loaded reports its signal as unknown, never as "not exploited", and a failed refresh keeps the previous data in force and flags it stale rather than replacing it with an empty list. Findings can be filtered with known_exploited=true or min_epss, and a release policy can fail a build on known_exploited or min_epss directly; see policies and verdicts.

Neither multiplier is call-graph reachability, and neither hides a finding. The reachability page says exactly when each applies. Dependency scope is recorded only for lockfile formats that mark development dependencies (npm, Yarn, pnpm, Poetry, uv, Composer and a few others); requirements.txt, go.mod, Maven, Cargo and OS packages are scored as shipped. The entrypoint mark is set only when the image configuration positively shows the package cannot be loaded: a node <script> entrypoint and a package outside every node_modules path it searches, or a Go or Rust binary entrypoint and a dependency compiled into a different binary or written in an interpreted language. A shell entrypoint, a wrapper script or an OS package is never marked. TrustIvan does not trace whether your code calls the vulnerable function.

For the mechanics behind the score, read from scan to verdict, or see how container scanning feeds the release gate. If a vendor says a high-EPSS CVE does not affect their image, writing a VEX statement covers how to judge whether that claim holds up.