TExcelTAD

CVE, CVSS and Patch Prioritisation

A vulnerability scan of a few hundred systems easily reports thousands of CVEs. No team patches thousands of things this week, so every organisation prioritises, and many do it badly: by sorting on the CVSS score. This lesson explains the identifiers and scores scanners print, why severity alone is a poor priority, and how to combine severity with exploitation evidence, exposure and asset importance into a patch plan. The scoring itself (every CVSS metric, with a calculator) is covered in depth in the Ethical Hacking & Penetration Testing course.

The identifiers

  • CVE (Common Vulnerabilities and Exposures): a unique ID for one publicly known vulnerability, CVE-YYYY-NNNN (year, then four or more digits), assigned by a CVE Numbering Authority (vendors, CERTs, MITRE) and published in the CVE list; NIST's NVD adds analysis such as CVSS scores and affected-product data (CPE).
  • CWE (Common Weakness Enumeration): the kind of flaw, such as CWE-79 (cross-site scripting) or CWE-787 (out-of-bounds write). Useful for trends ("most of our findings are CWE-1104, unmaintained third-party components").
  • Vendor advisories (Ubuntu USN, Debian DSA, Red Hat RHSA, Microsoft's Security Update Guide, vendor PSIRT pages): which product versions are affected and fixed. This is what decides whether your package is vulnerable.

CVSS: severity, not risk

The Common Vulnerability Scoring System (maintained by FIRST) rates a vulnerability's technical severity from 0.0 to 10.0. Version 3.1 is what most tools and NVD records still show; version 4.0 (published November 2023) refines the metrics and makes the distinction explicit by naming score types: CVSS-B (base only), CVSS-BT (with threat), CVSS-BE (with environmental), CVSS-BTE (all).

A v3.1 base vector such as AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H reads: attack vector network, attack complexity low, no privileges required, no user interaction, scope unchanged, high impact on confidentiality, integrity and availability. The program implements the v3.1 base-score formula from the specification and scores three vectors.

python · try it yourself
import math

W = {"AV": {"N": 0.85, "A": 0.62, "L": 0.55, "P": 0.2}, "AC": {"L": 0.77, "H": 0.44},
     "UI": {"N": 0.85, "R": 0.62}, "CIA": {"H": 0.56, "L": 0.22, "N": 0.0}}
PR = {"U": {"N": 0.85, "L": 0.62, "H": 0.27}, "C": {"N": 0.85, "L": 0.68, "H": 0.5}}

def roundup(x):
    i = round(x * 100000)
    return i / 100000.0 if i % 10000 == 0 else (math.floor(i / 10000) + 1) / 10.0

def cvss31(vector):
    m = dict(p.split(":") for p in vector.split("/"))
    iss = 1 - (1 - W["CIA"][m["C"]]) * (1 - W["CIA"][m["I"]]) * (1 - W["CIA"][m["A"]])
    impact = 6.42 * iss if m["S"] == "U" else 7.52 * (iss - 0.029) - 3.25 * (iss - 0.02) ** 15
    expl = 8.22 * W["AV"][m["AV"]] * W["AC"][m["AC"]] * PR[m["S"]][m["PR"]] * W["UI"][m["UI"]]
    if impact <= 0:
        return 0.0
    return roundup(min(impact + expl, 10)) if m["S"] == "U" else roundup(min(1.08 * (impact + expl), 10))

def rating(s):
    return "None" if s == 0 else "Low" if s < 4 else "Medium" if s < 7 else "High" if s < 9 else "Critical"

for v, what in [("AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "remote, unauthenticated, full compromise"),
                ("AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "local privilege escalation"),
                ("AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "reflected XSS")]:
    s = cvss31(v)
    print(f"{s:4}  {rating(s):8} {v}  ({what})")
 9.8  Critical AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H  (remote, unauthenticated, full compromise)
 7.8  High     AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H  (local privilege escalation)
 6.1  Medium   AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N  (reflected XSS)

These match the familiar values: 9.8 for the classic "remote code execution without authentication", 7.8 for a typical local privilege escalation, 6.1 for reflected XSS. The base score describes the vulnerability in general. It says nothing about whether anyone is exploiting it, whether the affected service is reachable in your network, or whether the host holds anything valuable.

The calculator lab starts on the local privilege escalation (7.8, High) and shows where the number comes from: an impact of 5.873 and an exploitability of only 1.835. Set AV to Network and the same bug scores 8.8. That AV describes how the flaw can be reached in general, not whether your copy is exposed: a 9.8 on an isolated lab host and a 9.8 on the VPN gateway get the same base score, which is why the next section adds context.

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HAttack VectorN .85A .62L .55P .2Attack ComplexityL .77H .44Privileges RequiredN .85L .62H .27User InteractionN .85R .62ScopeUCConfidentialityN 0L .22H .56IntegrityN 0L .22H .56AvailabilityN 0L .22H .56base score7.8High047910Impact 5.87max 5.87Exploitability 1.83max 3.89ISS = 1 − (1−0.56)(1−0.56)(1−0.56) = 0.915Impact = 6.42 × ISS = 5.873Exploitability = 8.22 × 0.55 × 0.77 × 0.62 × 0.85 = 1.835Base = Roundup(min((5.873 + 1.835), 10)) = 7.8

Adding the missing context

Signal Source What it adds
Known exploited CISA's Known Exploited Vulnerabilities (KEV) catalog; vendor and threat-intel reports the vulnerability is being used in real attacks now
Exploit prediction EPSS (Exploit Prediction Scoring System, FIRST): a probability (0–1) that the CVE will be exploited in the next 30 days, updated daily how likely exploitation is, across the Internet
Exposure your inventory and scans: Internet-facing? reachable from user networks? behind authentication? whether attackers can reach it here
Asset criticality the asset inventory: what the system does and holds how bad compromise would be here
Compensating controls segmentation, IPS signatures, the vulnerable feature disabled how much the risk is already reduced

Decision frameworks such as CISA's SSVC (Stakeholder-Specific Vulnerability Categorization) turn these questions into a decision tree ("Track", "Track*", "Attend", "Act"); many organisations use a simpler scoring of their own. The lab company's policy, as code:

python · try it yourself
import pandas as pd

# Fictional CVE IDs and values for the lab assessment; real ones come from NVD, EPSS and the KEV catalog.
f = pd.DataFrame([
    ("CVE-2026-10001", "files.lab.test", "Samba",       9.1, 0.42,  True,  "internal", 3),
    ("CVE-2026-10002", "www.lab.test",   "web app lib", 9.8, 0.003, False, "internet", 3),
    ("CVE-2026-10003", "vpn.lab.test",   "VPN gateway", 7.2, 0.91,  True,  "internet", 3),
    ("CVE-2026-10004", "db.lab.test",    "PostgreSQL",  8.8, 0.02,  False, "dmz-only", 3),
    ("CVE-2026-10005", "ws05.lab.test",  "PDF reader",  7.8, 0.15,  False, "user",     1),
    ("CVE-2026-10006", "prn40.lab.test", "printer fw",  6.5, 0.01,  False, "internal", 1),
    ("CVE-2026-10007", "www.lab.test",   "OpenSSH",     8.1, 0.05,  False, "internet", 3),
], columns=["cve", "host", "component", "cvss", "epss", "kev", "exposure", "criticality"])

EXPOSURE = {"internet": 3, "user": 2, "internal": 1, "dmz-only": 1}
def priority(r):
    if r.kev and r.exposure == "internet":
        return "P0: emergency, 48 h"
    if r.kev or (r.epss >= 0.1 and EXPOSURE[r.exposure] >= 2):
        return "P1: 7 days"
    if r.cvss >= 9 or (r.cvss >= 7 and EXPOSURE[r.exposure] == 3 and r.criticality == 3):
        return "P2: 30 days"
    return "P3: next cycle"
f["priority"] = f.apply(priority, axis=1)

print("sorted by CVSS only:      ", " ".join(f.sort_values("cvss", ascending=False).cve.str[-5:]))
out = f.sort_values(["priority", "epss"], ascending=[True, False])
print(out[["priority", "cve", "host", "component", "cvss", "epss", "kev", "exposure"]].to_string(index=False))
sorted by CVSS only:       10002 10001 10004 10007 10005 10003 10006
           priority            cve           host   component  cvss  epss   kev exposure
P0: emergency, 48 h CVE-2026-10003   vpn.lab.test VPN gateway   7.2 0.910  True internet
         P1: 7 days CVE-2026-10001 files.lab.test       Samba   9.1 0.420  True internal
         P1: 7 days CVE-2026-10005  ws05.lab.test  PDF reader   7.8 0.150 False     user
        P2: 30 days CVE-2026-10007   www.lab.test     OpenSSH   8.1 0.050 False internet
        P2: 30 days CVE-2026-10002   www.lab.test web app lib   9.8 0.003 False internet
     P3: next cycle CVE-2026-10004    db.lab.test  PostgreSQL   8.8 0.020 False dmz-only
     P3: next cycle CVE-2026-10006 prn40.lab.test  printer fw   6.5 0.010 False internal

The CVSS-only order puts the web library's 9.8 first. The policy puts the VPN gateway first: a lower CVSS of 7.2, but listed in KEV, a 91% exploitation probability, and Internet-facing. That is the pattern of many real breaches: an actively exploited flaw in a VPN or edge appliance, patched late because its score wasn't the highest on the list. The Samba flaw is known exploited and comes next, despite being internal only, together with the PDF reader on a staff workstation (EPSS 0.15, and users open PDFs from e-mail every day). The web library's 9.8 still gets a 30-day deadline because it is Internet-facing on a critical host, but with an EPSS of 0.003 it isn't an emergency.

From priority to plan

  • Deadlines per priority, agreed with the business and measured (mean time to remediate per priority, share of P0/P1 within deadline).
  • Emergency path for P0: patch out of cycle, or apply a mitigation within hours (disable the feature, restrict access, IPS signature) and patch next.
  • Exceptions with an owner, a compensating control and an end date when a patch can't be applied.
  • Verify with a rescan (A Network Assessment from Scope to Retest); a ticket closed without a rescan is a claim, not a fix.

Pitfalls

  • Sorting by CVSS base score and calling it risk.
  • Ignoring the "medium" that is in KEV and on the Internet.
  • Treating EPSS as a property of your network: it predicts exploitation activity in general, not on your hosts.
  • Patching the vulnerable package but not restarting the service (the old library stays loaded).
  • Forgetting the fix for end-of-life software is an upgrade, not a patch (Outdated Software).

Practice

1. Score AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H with the program. Why is it lower than 9.8?

8.1 (High). Attack complexity high lowers the exploitability sub-score (0.44 instead of 0.77); everything else is the same.

2. A finding has CVSS 5.3, EPSS 0.6, is not in KEV and the host is Internet-facing. What priority does the lab policy give it?

P1 (7 days): EPSS ≥ 0.1 and exposure "internet" (3 ≥ 2).

3. The VPN vendor's patch needs a reboot that the business refuses until the weekend. What do you do now?

Apply the vendor's mitigation if one exists (disable the vulnerable component, block the affected URL path), restrict access to known source ranges if possible, increase monitoring (vendor IOCs, integrity checks, new admin accounts, unusual sessions), check for signs of earlier compromise, record the exception with the weekend as its end date.

Test yourself

What does a CVSS base score measure?

  1. The risk to your organisation
  2. The technical severity of the vulnerability in general
  3. The probability of exploitation
  4. The cost of patching

What does EPSS estimate?

  1. The CVSS score
  2. The probability that a CVE will be exploited in the next 30 days
  3. Patch availability
  4. The number of affected hosts

Why did the VPN gateway's CVE get the highest priority despite CVSS 7.2?

  1. Its CVSS was rounded
  2. It is in the KEV catalog, highly likely to be exploited and Internet-facing
  3. VPNs are always first
  4. It has the oldest CVE ID

What is the CVSS v3.1 base score of AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H?

  1. 7.5
  2. 8.8
  3. 9.8
  4. 10.0

In the calculator lab, the local privilege escalation (7.8) gets AV:N instead of AV:L. Which sub-score changes?

  1. Only the impact
  2. Only the exploitability, so the base rises to 8.8
  3. Both, and the scope becomes Changed
  4. Neither; AV only changes the vector string