Skip to content
Tutorials Center
My learning

Topics

Lesson 20 of 38 ยท Exploitation Concepts

Vulnerability Classes and CVSS Scoring

Learn how penetration testers classify weaknesses with CWE and CVE, score them with CVSS 3.1, and decide which findings deserve a real validation attempt.

Before you try to exploit anything, you need a shared vocabulary. A vulnerability is a weakness in design, code, configuration or process that could let someone break a security goal (confidentiality, integrity or availability). An exploit is the technique that makes use of the weakness. The risk is the combination of how likely that is and how much damage follows.

This chapter teaches exploitation as a way to prove risk, never as a goal in itself. Everything here assumes written authorization, a defined scope and the safe-testing habits from the earlier chapters. See law and authorization if you need a refresher. The examples run on made-up data and stand-ins on this site: there are no real targets and no attack tooling.

The naming systems

Security people use three public catalogs so they can talk about the same thing:

Name Stands for What it identifies Example
CWE Common Weakness Enumeration A type of weakness CWE-89, SQL injection
CVE Common Vulnerabilities and Exposures One specific flaw in one product CVE-2021-44228, Log4Shell
CVSS Common Vulnerability Scoring System A 0.0 to 10.0 severity score 10.0 (critical)

A CVE record says which product and version is affected. A CWE says what kind of mistake it is. A CVSS vector says how bad it is in general. None of them says how bad it is in this customer's network. That judgment is your job, and chapter 8 covers risk rating.

Common vulnerability classes

Most findings fall into a handful of families:

  • Injection (SQL, command, LDAP, template): untrusted input is interpreted as code.
  • Broken access control: a user can reach data or actions that belong to someone else.
  • Authentication and session flaws: weak passwords, predictable tokens, missing lockout.
  • Memory corruption: buffer overflows and use-after-free in native code (next lesson).
  • Misconfiguration: default credentials, open admin panels, verbose errors, over-broad cloud permissions.
  • Cryptographic failures: plaintext traffic, weak algorithms, hard-coded keys.
  • Outdated components: known CVEs in libraries and services that were never patched.
  • Logic flaws: the code works as written but the business rule is wrong, such as a coupon that can be applied twice.

From weakness to risk

Weakness A kind of mistake (CWE)
Vulnerability That mistake in one product (CVE)
Exploit A way to use it
Risk Likelihood times impact here

Scores describe the flaw. Risk describes your client.

1 / 2

How CVSS works

CVSS version 3.1 produces a base score from eight metrics. Four describe how the flaw is reached (the exploitability group) and three describe the damage (the impact group), plus scope.

Metric Values
Attack Vector (AV) Network, Adjacent, Local, Physical
Attack Complexity (AC) Low, High
Privileges Required (PR) None, Low, High
User Interaction (UI) None, Required
Scope (S) Unchanged, Changed
Confidentiality, Integrity, Availability (C, I, A) High, Low, None

The result is written as a vector string, for example AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, which means "reachable over the network, easy, no login, no user action, full loss of all three goals" and scores 9.8. The score maps to a band: 0.1-3.9 low, 4.0-6.9 medium, 7.0-8.9 high, 9.0-10.0 critical.

The formulas are published in the CVSS specification, so you can implement them. This stand-in calculator uses the 3.1 weights and the official round-up rule.

Python A CVSS 3.1 base score calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The first sample is the well-known 9.8 and the second reaches 10.0 because a changed scope means the flaw lets the attacker affect resources beyond the vulnerable component. Trying vectors by hand teaches you which metric moves the number most: requiring a login (PR) or a victim click (UI) pulls scores down sharply.

Triage: which flaws to validate?

A scanner may report hundreds of items. A tester picks what to validate by asking:

  1. Is it really there? Scanners guess from banners; version numbers can be wrong or backported.
  2. Is it reachable from the position the engagement simulates (internet, guest Wi-Fi, a stolen laptop)?
  3. What does it give? Code execution, data, a foothold for the next step?
  4. How safe is the check? Prefer a harmless proof (reading a version, a benign marker file, one record) over anything that could crash a service. If the rules of engagement forbid risky tests, report the finding as "unconfirmed, likely" instead.
Python Rank scanner findings for validation

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The output order is not just by CVSS: reachability and safety change what you do. That is the habit to build, because the highest score is not always the finding you should touch first.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a CWE identifier describe?

    CWE catalogs kinds of weaknesses. A CVE names one specific vulnerability in a product, and CVSS gives a severity score.
  2. 2. A flaw is reachable over the network, easy to use, needs no login or user action, and fully compromises confidentiality, integrity and availability, with scope unchanged. What is its CVSS 3.1 base score?

    That vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) scores 9.8. 10.0 needs a changed scope.
  3. 3. Why is a CVSS base score alone not the final risk for a client?

    The base score describes the flaw in general. Risk depends on where the asset sits, what it holds and which controls surround it.
  4. 4. A memory bug on a fragile production service is rated 9.1 and the rules of engagement forbid outages. What is the best action?

    Safety and scope come first. Reporting a clearly labelled unconfirmed finding, or getting explicit approval for a test window, is the professional route.

Summary

  • A vulnerability is a weakness, an exploit uses it, and risk is likelihood times impact in a specific environment.
  • CWE names weakness types, CVE names individual flaws, CVSS scores severity from eight metrics.
  • Common classes: injection, broken access control, authentication flaws, memory corruption, misconfiguration, crypto failures, outdated components and logic flaws.
  • Triage by existence, reachability, outcome and safety of the check before you validate anything.

Next: How memory corruption works