TExcelTAD
Home › Security Foundations: Concepts, Law, Ethics & Your Lab › Threat, Vulnerability, Exploit and Risk

Threat, Vulnerability, Exploit and Risk

"We have a critical vulnerability!" can mean a bug in a test machine nobody can reach, or a hole in the payment system that criminals are already using. Security teams waste time and money when they mix up the words for these situations. This lesson pins down the vocabulary the rest of the track uses, and shows that risk is what you actually manage: the other words are its ingredients.

The intuition: a house

Your house is the asset. Burglars in the area are the threat. A back window that doesn't lock is a vulnerability. Climbing through that window is the exploit, and the burglar's route through the garden to it is the attack vector. The risk is how likely a break-in through that window is and how bad it would be. Fix the lock and the risk falls, even though the burglars are still around. Move to a house with nothing worth stealing and the broken lock hardly matters.

Definitions

Term Meaning Example
Asset anything of value: data, systems, services, people, reputation the customer database
Threat a potential cause of harm: an actor, an event or a circumstance a criminal group selling stolen card data; a flood
Threat actor the person or group behind a deliberate threat, with a motive and a capability organised crime, a state agency, a hacktivist, an insider, an opportunist using public tools
Vulnerability a weakness that a threat could use a search box that builds SQL by string concatenation
Exploit a technique or piece of code that uses a vulnerability input that makes the search query return every row
Attack vector the route used to reach the vulnerability the public website, an email attachment, a USB stick
Risk the combination of how likely harm is and how large it would be "likely and severe: the shop is public and the bug is easy to find"
Control a measure that reduces risk parameterised queries, a web application firewall, monitoring

Two refinements. A zero-day is a vulnerability the vendor doesn't know about yet or has no fix for, so there are "zero days" to patch; an n-day has a published fix that some systems haven't applied, and most real intrusions use n-days. And the threat actor's capability matters: a weakness that needs physical access and a lab of equipment is a different risk from one that a scripted scanner finds in minutes. The on-ramp lesson Threats, Vulnerabilities & Attackers describes the actor types and their motives.

No risk without all the ingredients

Risk needs something of value, a weakness in it and a threat able to reach it. Remove any one and the risk from that scenario disappears:

python · try it yourself
# Risk needs all three: something of value, a weakness in it, and someone or something able to use it.
scenarios = [
    # (description, asset value, vulnerability present, threat able to reach it)
    ("Public web shop, SQL injection in search",          "high",   True,  True),
    ("Same bug, app only on an offline lab VM",           "none",   True,  False),
    ("Payroll database, fully patched, internet-facing",  "high",   False, True),
    ("Old NAS with default password on the office Wi-Fi",  "medium", True,  True),
]
for text, value, vuln, threat in scenarios:
    risk = value != "none" and vuln and threat
    missing = [name for name, ok in (("asset", value != "none"), ("vulnerability", vuln), ("threat", threat)) if not ok]
    print(f"{'RISK   ' if risk else 'no risk'}  {text}" + (f"  (missing: {', '.join(missing)})" if missing else ""))
RISK     Public web shop, SQL injection in search
no risk  Same bug, app only on an offline lab VM  (missing: asset, threat)
no risk  Payroll database, fully patched, internet-facing  (missing: vulnerability)
RISK     Old NAS with default password on the office Wi-Fi

The second line is why the deliberately vulnerable apps of your lab are safe to keep: no real data and no route from outside. The third line is the honest caveat: "no known vulnerability". Software always has unknown bugs, so a valuable internet-facing system still carries residual risk, which monitoring and backups exist for. The model is a yes/no simplification; Risk Assessment turns it into scores.

Naming vulnerabilities: CVE and CWE

Two public catalogues give vulnerabilities shared names, so a scanner, an advisory and a patch note can talk about the same thing:

  • CVE (Common Vulnerabilities and Exposures) names one specific flaw in one product: CVE-<year>-<number>, the number having four or more digits. CVE IDs are assigned by CVE Numbering Authorities (vendors, CERTs, research groups) under the CVE Program, which MITRE has long operated with US government (CISA) sponsorship (its funding and governance have been under discussion since 2025).
  • CWE (Common Weakness Enumeration) names the class of mistake: CWE-89 is SQL injection, CWE-79 cross-site scripting, CWE-22 path traversal, CWE-287 improper authentication, CWE-798 hard-coded credentials. Many CVEs share one CWE.
  • CVSS scores how severe a CVE is in general; it is not your risk, because it doesn't know your assets or exposure. The on-ramp's Vulnerability Management & CVSS shows the calculation, and sec-pentest adds EPSS and the CISA KEV catalogue.

How vulnerabilities are detected

You can't manage what you haven't found. Defenders find vulnerabilities by keeping an asset inventory with product versions and matching it against advisories (this is what a vulnerability scanner does at its core), by configuration reviews, code review and testing, and by reports from outside researchers (responsible disclosure). The matching step, with fictional advisories for fictional products in the lab domain:

python · try it yourself
# Detection: match an asset inventory against (fictional) advisories by product and version.
def ver(s):
    return tuple(int(part) for part in s.split("."))

advisories = [  # id, product, fixed in, weakness class
    ("LAB-ADV-0001", "shopcart", "2.4.1", "CWE-89 SQL injection"),
    ("LAB-ADV-0002", "nas-os",   "7.0.0", "CWE-798 hard-coded credentials"),
    ("LAB-ADV-0003", "mailgw",   "5.2.3", "CWE-79 cross-site scripting"),
]
inventory = [  # host, product, installed version
    ("web01.lab.test",  "shopcart", "2.3.9"),
    ("web02.lab.test",  "shopcart", "2.4.1"),
    ("nas.lab.test",    "nas-os",   "6.9.12"),
    ("mail.lab.test",   "mailgw",   "5.10.0"),
]
for host, product, installed in inventory:
    for adv_id, adv_product, fixed, cwe in advisories:
        if product == adv_product and ver(installed) < ver(fixed):
            print(f"{host:<15} {product:<9}{installed:<7} < {fixed:<6} {adv_id}  {cwe}")
print("string comparison would say '5.10.0' < '5.2.3':", "5.10.0" < "5.2.3")
web01.lab.test  shopcart 2.3.9   < 2.4.1  LAB-ADV-0001  CWE-89 SQL injection
nas.lab.test    nas-os   6.9.12  < 7.0.0  LAB-ADV-0002  CWE-798 hard-coded credentials
string comparison would say '5.10.0' < '5.2.3': True

Two hosts are affected; web02 already has the fix and mail (5.10.0) is newer than the fixed 5.2.3. The last line shows a classic bug in home-made scanners: comparing versions as strings would have flagged the mail gateway wrongly, because "1" sorts before "2". Real version schemes (2.4.1-rc1, distribution back-ports that fix a bug without changing the upstream version) make matching harder still, which is one source of scanner false positives.

How risk is reduced

Each ingredient gives a lever:

  • Vulnerability: patch, reconfigure, fix the code. This removes the weakness and is usually the best lever.
  • Exposure to the threat: take the system off the internet, put it behind a VPN, segment the network. The bug stays but fewer actors can reach it.
  • Impact on the asset: store less data, encrypt it, keep backups, so a successful attack costs less.
  • Detection: monitoring doesn't stop the first step of an attack but shortens the time an attacker has.

Choosing between them, and deciding when a risk is acceptable, is risk treatment.

Pitfalls

  • Calling everything a threat. "SQL injection is a threat" mixes the weakness (the vulnerability) with who might use it (the threat). Precise words lead to precise fixes.
  • Severity equals priority. A CVSS 9.8 on an isolated test box can wait; a 6.5 on the internet-facing login page that is actively exploited cannot.
  • "No known vulnerabilities" means safe. It means "none found yet". Keep the inventory current and the logs on.
  • Ignoring non-technical threats. Fire, a cleaner unplugging a server, an employee leaving with the only admin password: all are threats to availability.

Practice

  1. Classify each as asset, threat, vulnerability, exploit or control: (a) a ransomware gang, (b) an unpatched VPN appliance, (c) the HR file share, (d) multi-factor authentication, (e) a script that sends a crafted packet to trigger a known bug.
  2. Two hosts run shopcart: 2.4.0 and 2.10.0. Which are affected by LAB-ADV-0001 (fixed in 2.4.1)? What would string comparison answer?
  3. Give one way to reduce the risk of the NAS scenario through each of the three ingredients.
Answers
  1. (a) threat (a threat actor), (b) vulnerability (the weakness is the missing patch; the appliance itself is an asset), (c) asset, (d) control, (e) exploit.
  2. 2.4.0 is affected, 2.10.0 is not. As strings, "2.10.0" < "2.4.1" is true (the character 1 sorts before 4), so a string comparison would wrongly flag 2.10.0 as well.
  3. Vulnerability: change the default password, update the firmware. Threat exposure: move it to a separate network segment that guests can't reach. Asset/impact: keep only what is needed on it and have an offline backup.

Test yourself

A web server runs a version with a published fix that hasn't been applied. What is that called?

  1. A zero-day
  2. An n-day vulnerability
  3. A threat actor
  4. An exploit

Which identifier names a class of mistake rather than one flaw in one product?

  1. CVE-2024-12345
  2. CWE-89
  3. CVSS 9.8
  4. An advisory number

A vulnerable app runs on a VM with no network connection and no real data. Why is its risk low?

  1. The bug is fixed
  2. No threat can reach it and there is no valuable asset
  3. CVSS is low
  4. Vulnerable apps cannot be exploited

In the matching example, why is ver('5.10.0') < ver('5.2.3') False while '5.10.0' < '5.2.3' is True?

  1. Tuples compare numbers part by part (5 = 5, then 10 > 2), strings compare character by character ('1' < '2')
  2. Python has a bug
  3. Tuples ignore the last part
  4. Strings are compared by length