Vulnerability Management & CVSS
New vulnerabilities are published every day: tens of thousands of CVEs per year. No team can fix everything at once, so vulnerability management is the continuous process of finding weaknesses in your own systems, deciding which matter most, fixing them, and checking the fix.
The cycle
- Inventory: you can't protect what you don't know you have. Keep a list of assets: servers, cloud resources, laptops, applications and their dependencies (a Software Bill of Materials, SBOM).
- Identify: authenticated vulnerability scanners for hosts, dependency scanners (SCA) for code, cloud configuration scanners, penetration tests, bug bounty reports, vendor advisories.
- Prioritise: by severity, exploitability and exposure (below).
- Remediate: patch, upgrade, change configuration, or apply a temporary mitigation (disable a feature, block at the WAF) when a patch isn't available yet.
- Verify: rescan to confirm the fix; track the time to remediate.
Identifiers you'll meet
| Name | What it is |
|---|---|
| CVE | A unique ID for a publicly known vulnerability, e.g. CVE-2021-44228 (Log4Shell) |
| CWE | The type of weakness, e.g. CWE-89 SQL injection, CWE-79 XSS |
| CVSS | A 0.0–10.0 severity score with a vector describing the vulnerability |
| EPSS | A probability estimate that a CVE will be exploited in the next 30 days |
| CISA KEV | A catalogue of vulnerabilities known to be exploited in the wild |
| Zero-day | A vulnerability exploited before the vendor has a fix |
CVSS v3.1 base score
CVSS (Common Vulnerability Scoring System) describes a vulnerability with eight base metrics, written as a vector such as CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H:
| Metric | Values | Question |
|---|---|---|
| AV, Attack Vector | Network, Adjacent, Local, Physical | From where can it be exploited? |
| AC, Attack Complexity | Low, High | Are special conditions needed? |
| PR, Privileges Required | None, Low, High | Must the attacker be logged in? |
| UI, User Interaction | None, Required | Must a victim click something? |
| S, Scope | Unchanged, Changed | Does impact reach beyond the vulnerable component? |
| C / I / A | High, Low, None | Impact on confidentiality, integrity, availability |
The specification defines exact weights and formulas, so everyone computes the same number. Here is a complete implementation of the v3.1 base score:
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):
# CVSS v3.1 "round up to one decimal", defined to avoid floating-point surprises
i = round(x * 100000)
return i / 100000.0 if i % 10000 == 0 else (math.floor(i / 10000) + 1) / 10.0
def base_score(vector):
m = dict(part.split(":") for part in vector.split("/")[1:])
scope = m["S"]
iss = 1 - (1 - W["CIA"][m["C"]]) * (1 - W["CIA"][m["I"]]) * (1 - W["CIA"][m["A"]])
if scope == "U":
impact = 6.42 * iss
else:
impact = 7.52 * (iss - 0.029) - 3.25 * (iss - 0.02) ** 15
exploitability = 8.22 * W["AV"][m["AV"]] * W["AC"][m["AC"]] * PR[scope][m["PR"]] * W["UI"][m["UI"]]
if impact <= 0:
return 0.0
if scope == "U":
return roundup(min(impact + exploitability, 10))
return roundup(min(1.08 * (impact + exploitability), 10))
def rating(score):
if score == 0: return "None"
if score < 4: return "Low"
if score < 7: return "Medium"
if score < 9: return "High"
return "Critical"
vectors = [
"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H", # Log4Shell-like
"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", # typical reflected XSS
"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", # local privilege escalation
"CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N",
]
for v in vectors:
s = base_score(v)
print(f"{s:>4} {rating(s):<8} {v}")10.0 Critical CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
9.8 Critical CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
6.1 Medium CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
7.8 High CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
2.0 Low CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
These match the official calculator: 10.0 for the Log4Shell vector, 9.8 for an unauthenticated network RCE without scope change, 6.1 for typical reflected XSS, and 7.8 for a local privilege escalation. (CVSS v4.0, published in 2023, refines the metrics; v3.1 is still the most common in databases and scanners.)
Severity is not priority
CVSS measures how bad a vulnerability could be in general. Your priority also depends on your situation: is the system exposed to the internet, does it hold sensitive data, is the vulnerability actually being exploited (KEV, high EPSS)? A medium-severity bug with a public exploit on your internet-facing login page may be more urgent than a critical one on an isolated lab machine.
findings = [
{"cve": "CVE-A", "cvss": 9.8, "kev": False, "epss": 0.02, "internet": False, "asset": "lab"},
{"cve": "CVE-B", "cvss": 7.5, "kev": True, "epss": 0.91, "internet": True, "asset": "vpn"},
{"cve": "CVE-C", "cvss": 6.1, "kev": False, "epss": 0.40, "internet": True, "asset": "shop"},
{"cve": "CVE-D", "cvss": 8.8, "kev": False, "epss": 0.05, "internet": True, "asset": "intranet"},
]
SLA_DAYS = {"P1": 2, "P2": 14, "P3": 30, "P4": 90}
def priority(f):
if f["kev"] and f["internet"]:
return "P1"
if f["cvss"] >= 7 and f["internet"] or f["epss"] >= 0.3:
return "P2"
if f["cvss"] >= 7:
return "P3"
return "P4"
for f in sorted(findings, key=lambda f: (priority(f), -f["cvss"])):
p = priority(f)
print(f"{p} fix within {SLA_DAYS[p]:>2} days {f['cve']} cvss={f['cvss']} kev={f['kev']} asset={f['asset']}")P1 fix within 2 days CVE-B cvss=7.5 kev=True asset=vpn
P2 fix within 14 days CVE-D cvss=8.8 kev=False asset=intranet
P2 fix within 14 days CVE-C cvss=6.1 kev=False asset=shop
P3 fix within 30 days CVE-A cvss=9.8 kev=False asset=lab
CVE-A has the highest CVSS score but ends up with priority P3: it isn't exploited in the wild and the lab machine isn't reachable from the internet. CVE-B, known to be exploited on the internet-facing VPN, must be fixed within days.
Patching in practice
- Define remediation SLAs per priority and measure against them.
- Patch on a regular schedule and have an emergency path for P1 issues.
- Test patches on a staging environment, but don't let testing become an excuse for months of delay.
- Automate dependency updates (Dependabot, Renovate) and keep upgrades small and frequent.
- When you can't patch (an old medical device, an unsupported system), isolate it and document the accepted risk.
Go further: CVSS v3.1: A Base and Temporal Calculator works through the formulas with an interactive calculator, and EPSS and the CISA KEV Catalog shows how to rank by likely exploitation.
Test yourself
What does the CVSS metric AV:N mean?
- No attack vector
- The vulnerability can be exploited over the network
- No privileges required
- Needs physical access
Which finding should usually be fixed first?
- CVSS 9.8 on an isolated lab machine, no known exploitation
- CVSS 7.5 on an internet-facing VPN, listed in CISA KEV
- CVSS 4.3 on an internal wiki
- They all have the same priority
What is a CWE?
- A specific vulnerability in a product
- A category/type of software weakness, like SQL injection
- A severity score
- A patch