On this page

CVSS (the Common Vulnerability Scoring System) version 3.1 rates the severity of a vulnerability from 0.0 to 10.0. You choose a value for eight base metrics: Attack Vector, Attack Complexity, Privileges Required, User Interaction, Scope, and the Confidentiality, Integrity and Availability impacts. A CVSS 3.1 calculator turns those choices into a score and a vector string such as CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, which scores 9.8 (Critical).

This guide explains each metric, how the score is calculated, how to read a vector string and how to avoid the most common scoring mistakes. It ends with what changed in CVSS 4.0.

CVSS severity ratings

CVSS 3.1 maps numeric scores to five qualitative ratings:

Score Severity
0.0 None
0.1 to 3.9 Low
4.0 to 6.9 Medium
7.0 to 8.9 High
9.0 to 10.0 Critical

A CVSS score measures severity, not risk. FIRST, the organization that maintains CVSS, makes this point in the specification. A 9.8 on an isolated lab server may matter less to you than a 6.5 on your billing API. Use the score as a consistent starting point, then add your own context.

The three CVSS metric groups

CVSS 3.1 has three groups of metrics:

  • Base metrics describe the vulnerability itself. They do not change over time or between environments. This is what most people mean by “the CVSS score”.
  • Temporal metrics adjust for things that change over time: whether exploit code exists (Exploit Code Maturity), whether a fix is available (Remediation Level) and how confident we are that the vulnerability is real (Report Confidence).
  • Environmental metrics tailor the score to your organization. You can weight confidentiality, integrity and availability requirements, or modify base metrics to reflect your own controls.

Pentest reports and vulnerability databases almost always publish the base score, so the rest of this guide focuses on it.

The base metrics, one by one

Exploitability metrics

Attack Vector (AV) describes how remote the attacker can be.

  • Network (N): exploitable over the network, including the internet. Most web vulnerabilities.
  • Adjacent (A): the attacker must share a network segment, such as the same Wi-Fi, Bluetooth range or local subnet.
  • Local (L): the attacker needs local access, such as a shell on the machine, or relies on a user to open a malicious file.
  • Physical (P): the attacker must physically touch the device.

Attack Complexity (AC) covers conditions beyond the attacker’s control.

  • Low (L): the attack works reliably, whenever the attacker tries.
  • High (H): success depends on something the attacker cannot control, such as winning a race condition or first gathering target-specific secrets.

Privileges Required (PR) is the access the attacker needs before the attack.

  • None (N): unauthenticated.
  • Low (L): a basic user account.
  • High (H): administrative or otherwise significant privileges.

User Interaction (UI) asks whether someone other than the attacker must take part.

  • None (N): no victim action needed.
  • Required (R): a user must click a link, open a file or visit a page.

Scope (S)

Scope asks whether the vulnerability can affect resources beyond the security authority of the vulnerable component.

  • Unchanged (U): the impact stays within the vulnerable component.
  • Changed (C): the impact crosses a security boundary. Cross-site scripting is the classic example: the flaw is in the web application, but the attacker’s script runs in the victim’s browser. A virtual machine escape that reaches the host is another.

Scope changes the formula, so it matters. Do not set it to Changed just because the impact feels large.

Impact metrics

Confidentiality (C), Integrity (I) and Availability (A) each take one of three values:

  • High (H): a total loss, or a serious loss of something important. For example, reading the whole database or taking full control of the system.
  • Low (L): some loss, but limited in what the attacker can access or control.
  • None (N): no impact.

Score what a successful attacker can realistically achieve with this vulnerability, not a hypothetical chain of further flaws you have not found.

How to read a CVSS vector string

A vector string records every metric choice, so anyone can check the reasoning behind a score. Take this one:

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Read it left to right: CVSS version 3.1, Attack Vector Network, Attack Complexity Low, Privileges Required Low, User Interaction None, Scope Unchanged, Confidentiality High, Integrity None, Availability None. That is a typical broken access control flaw where any logged-in user can read other users’ data. It scores 6.5 (Medium).

The base metrics always appear in this order. Temporal and environmental metrics, if used, are appended after them, for example /E:P/RL:O/RC:C.

How a CVSS 3.1 calculator works

Every CVSS 3.1 calculator applies the same published formula. Each metric value has a numeric weight:

Metric Values and weights
Attack Vector N 0.85 · A 0.62 · L 0.55 · P 0.2
Attack Complexity L 0.77 · H 0.44
Privileges Required N 0.85 · L 0.62 (0.68 if Scope Changed) · H 0.27 (0.5 if Scope Changed)
User Interaction N 0.85 · R 0.62
Confidentiality, Integrity, Availability H 0.56 · L 0.22 · N 0

The calculation then runs in four steps:

  1. Impact Sub-Score (ISS) = 1 − [(1 − C) × (1 − I) × (1 − A)]
  2. Impact: if Scope is Unchanged, 6.42 × ISS. If Scope is Changed, 7.52 × (ISS − 0.029) − 3.25 × (ISS − 0.02)15.
  3. Exploitability = 8.22 × AV × AC × PR × UI
  4. Base score: if Impact is 0 or less, the score is 0.0. Otherwise, with Scope Unchanged, round up min(Impact + Exploitability, 10). With Scope Changed, round up min(1.08 × (Impact + Exploitability), 10).

“Round up” means up to the next tenth: 9.76 becomes 9.8, and 6.007 becomes 6.1.

Worked example: 9.8 Critical

Score an unauthenticated remote code execution flaw: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.

  1. ISS = 1 − (0.44 × 0.44 × 0.44) = 0.9148
  2. Impact (Scope Unchanged) = 6.42 × 0.9148 = 5.873
  3. Exploitability = 8.22 × 0.85 × 0.77 × 0.85 × 0.85 = 3.887
  4. Base score = round up (5.873 + 3.887) = round up (9.760) = 9.8

Worked example: 6.1 Medium, with Scope Changed

Score a reflected cross-site scripting flaw: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.

  1. ISS = 1 − (0.78 × 0.78 × 1) = 0.3916
  2. Impact (Scope Changed) = 7.52 × (0.3916 − 0.029) − 3.25 × (0.3716)15 = 2.727 (the second term is tiny)
  3. Exploitability = 8.22 × 0.85 × 0.77 × 0.85 × 0.62 = 2.835
  4. Base score = round up (1.08 × (2.727 + 2.835)) = round up (6.007) = 6.1

A CVSS 3.1 base score calculator in Python

Here is a minimal implementation of the formula, including the rounding function defined in the CVSS 3.1 specification. It is handy for checking scores in scripts and tests.

import math

WEIGHTS = {
    "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},
}
# Privileges Required depends on Scope (U = Unchanged, C = Changed)
PR = {
    "U": {"N": 0.85, "L": 0.62, "H": 0.27},
    "C": {"N": 0.85, "L": 0.68, "H": 0.5},
}


def roundup(value: float) -> float:
    """Round up to one decimal, as defined in CVSS 3.1 Appendix A."""
    int_input = round(value * 100000)
    if int_input % 10000 == 0:
        return int_input / 100000.0
    return (math.floor(int_input / 10000) + 1) / 10.0


def base_score(vector: str) -> float:
    m = dict(part.split(":") for part in vector.split("/")[1:])
    scope = m["S"]
    c, i, a = (WEIGHTS["CIA"][m[k]] for k in ("C", "I", "A"))
    iss = 1 - (1 - c) * (1 - i) * (1 - a)
    if scope == "U":
        impact = 6.42 * iss
    else:
        impact = 7.52 * (iss - 0.029) - 3.25 * (iss - 0.02) ** 15
    exploitability = (
        8.22
        * WEIGHTS["AV"][m["AV"]]
        * WEIGHTS["AC"][m["AC"]]
        * PR[scope][m["PR"]]
        * WEIGHTS["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))


print(base_score("CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"))  # 9.8

It returns the base score only. Temporal or environmental metrics appended to the vector are ignored.

Common vulnerabilities and their CVSS 3.1 scores

Every vector below starts with CVSS:3.1/, omitted here for space.

Finding Vector Score
Unauthenticated remote code execution AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 9.8 Critical
Unauthenticated SQL injection (read and modify data) AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N 9.1 Critical
Local privilege escalation to root AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H 7.8 High
Unauthenticated denial of service AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H 7.5 High
Broken access control (read other users’ data) AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N 6.5 Medium
Reflected cross-site scripting AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N 6.1 Medium
Stored cross-site scripting by a logged-in user AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N 5.4 Medium
Cross-site request forgery (minor setting change) AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N 4.3 Medium

Treat these as starting points, not fixed answers. The same vulnerability class can score very differently depending on what an attacker can actually reach.

Common CVSS scoring mistakes

  • Confusing PR and UI. Privileges Required is about the attacker’s access. User Interaction is about a victim’s action. A stored XSS posted by a logged-in attacker that fires when an admin views the page is PR:L and UI:R.
  • Overusing Scope Changed. Scope changes only when the impact crosses a security authority, not when the impact is severe.
  • Scoring the chain instead of the flaw. Score each vulnerability on its own merits. If you also report a chain of issues as a separate finding, score the chain separately and explain it.
  • Using AC:H for obscurity. A hard-to-find endpoint is not high complexity. AC:H is for conditions outside the attacker’s control, such as a race window.
  • Mixing base and environmental scores. If you adjust for your environment, say so and publish the full vector, so readers can see what changed.

CVSS 4.0: what changed

FIRST published CVSS 4.0 in November 2023. CVSS 3.1 remains widely used in pentest reports and vulnerability databases, so expect to see both versions side by side for some time. The main differences:

  • New metric groups. Base, Threat (replacing Temporal, and reduced to Exploit Maturity), Environmental, and a new Supplemental group, with metrics such as Safety, Automatable and Recovery, that adds context without changing the score.
  • Scope is gone. Instead, impacts are scored separately for the vulnerable system (VC, VI, VA) and for subsequent systems (SC, SI, SA).
  • Attack Requirements (AT) is a new base metric for deployment conditions the attack depends on, separating them from Attack Complexity.
  • User Interaction is more granular: None, Passive or Active.
  • Scores come from lookup tables of equivalence classes rather than the 3.1 formula, and labels show which metrics were used: CVSS-B (base only), CVSS-BT, CVSS-BE and CVSS-BTE.
  • The severity bands are unchanged. Low, Medium, High and Critical use the same ranges as 3.1.

A CVSS 4.0 base vector looks like this:

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Do not convert scores between versions by hand. A 3.1 score and a 4.0 score for the same flaw can differ, so always state which version you used.

Score findings where you track them

In WhyXpose, every vulnerability has a built-in CVSS 3.1 calculator. Choose the metrics and the vector and score are stored with the finding, next to its severity, proof of concept and remediation. WhyXpose AI triages findings and ranks them so the riskiest get attention first, but the score itself is always set by an expert: a pentester chooses the vector for every finding. You can also search CVEs from the public NVD database without leaving the platform. See how it works in Vulnerability Management, where scored findings also flow into a branded PDF pentest report. To write up each finding well, read our penetration test report guide.

Book a demo to see the calculator, findings and reports in action.

Put this guide into practice

Every finding we report carries a CVSS 3.1 vector, a proof of concept and a fix your developers can act on.

Explore pentest services