ESC

Version Notes

Per-version quirks and spec compliance notes

Vector-string prefixes

The CVSS:x.y/ prefix is mandatory from CVSS v3.0 onward. v1.0 and v2.0 predate it, so their vectors are normally written bare — CVSS.parse accepts them with or without the parentheses NVD renders them in, and tolerates a CVSS:1.0/ or CVSS:2.0/ prefix that some tools add for symmetry with v3+.

The prefix literal is matched case-insensitively (cvss:3.1/… parses like CVSS:3.1/…), because lower- and mixed-case spellings turn up in real feeds. Metric keys and values stay case-sensitive, as the specs require.

A prefix-less string carrying v3.x or v4.0 metrics is reported as an error rather than guessed at — for v3.x the prefix is the only thing that separates v3.0 from v3.1, and the two use different RoundUp and modified-impact formulas:

CVSS.parse("AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H")
# CVSS::ParseError: vector carries CVSS v3.x metrics but no 'CVSS:3.0/' or 'CVSS:3.1/' prefix; ...

CVSS v1.0

CVSS v2.0

CVSS v3.0 vs v3.1

Both versions are handled by the same CVSS::V3::Vector class. They share metric definitions and the base scoring formula. They differ in two places:

  1. RoundUp algorithm

    • v3.0: ceiling(input × 10) / 10
    • v3.1: integer-space spec algorithm that avoids floating-point edge cases on values like 4.65.
  2. Modified Impact polynomial (Environmental score, Scope:Changed)

    • v3.0: 7.52 × (ISS - 0.029) - 3.25 × (ISS - 0.02)^15
    • v3.1: 7.52 × (ISS - 0.029) - 3.25 × (ISS × 0.9731 - 0.02)^13

vec.version always returns the parsed version string ("3.0" or "3.1"); round-trips via to_s preserve it.

CVSS v4.0

Cross-version comparisons

Vector includes Comparable(Vector) and orders by base_score, so <, >, and sort all work across versions. Equality, however, is structural — a v3 vector and a v4 vector are never == even when their scores are identical.