Skip to content

🏷️ severity ​

🏷️ Rating · 🟢 stable

Synopsis ​

cvss severity maps a numeric CVSS score to its qualitative severity rating. It is handy when you already have a score (from a scanner, spreadsheet or API) and only need the rating, without parsing a full vector.

How It Works ​

A single numeric score is read and mapped through the v3.1 threshold table to one of five ratings; nothing is parsed or scored.

Usage ​

bash
cvss severity [score] [flags]

Flags ​

FlagTypeDefaultDescription
--formatstringtextOutput format: text or json
-h, --helpboolfalseHelp for severity

CVSS v3.1 thresholds ​

RatingRange
None0.0
Low0.1 – 3.9
Medium4.0 – 6.9
High7.0 – 8.9
Critical9.0 – 10.0

v3.0 vs v3.1

The numeric thresholds are identical for v3.0 and v3.1, but a given vector may produce a slightly different score across versions (notably for UI:R), which can push it across a boundary. severity itself is version-agnostic — it only looks at the number you give it.

Examples ​

bash
cvss severity 7.5
text
High
bash
cvss severity --format json 9.2
json
{
  "score": 9.2,
  "severity": "Critical"
}

Underlying API ​

Calls the standalone cvss.GetSeverity function, which returns a cvss.Severity value. No vector parsing is required.

go
import (
    "fmt"

    "github.com/scagogogo/cvss-skills/pkg/cvss"
)

severity := cvss.GetSeverity(9.2)
fmt.Println(severity) // Critical

Released under the MIT License.