CVSS helpers: computes CVSS v3.0/v3.1 base scores and CVSS v4.0 scores
(VulnCheck.Feeds.CVSS.V4) from vector strings.
Summary
Functions
Computes the score of a CVSS v3.x or v4.0 vector, or nil when the
vector is not valid. A v4.0 vector with Threat or Environmental metrics is
scored with them.
CycloneDX method name corresponding to the vector header.
Returns the CVSS major version of a vector string (3 or 4), or nil.
Types
Functions
Computes the score of a CVSS v3.x or v4.0 vector, or nil when the
vector is not valid. A v4.0 vector with Threat or Environmental metrics is
scored with them.
iex> VulnCheck.Feeds.CVSS.base_score("CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H")
9.8
iex> VulnCheck.Feeds.CVSS.base_score("CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H")
7.5
iex> VulnCheck.Feeds.CVSS.base_score("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")
9.3
iex> VulnCheck.Feeds.CVSS.base_score("not a vector")
nil
CycloneDX method name corresponding to the vector header.
@spec version(String.t() | nil) :: 3 | 4 | nil
Returns the CVSS major version of a vector string (3 or 4), or nil.