Skip to content

feat: add support for CVSS 4.0 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

> Mappings of the CVE JSON structures for Rust

See: <https://github.com/CVEProject/cve-schema/blob/master/schema/v5.0/CVE_JSON_5.0_schema.json>
See: <https://github.com/CVEProject/cve-schema/blob/main/schema/CVE_Record_Format.json>
6 changes: 5 additions & 1 deletion src/published.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub struct Impact {
pub descriptions: Vec<Description>,
}

/// This is impact type information (e.g. a text description, CVSSv2, CVSSv3, etc.). Must contain: At least one entry, can be text, CVSSv2, CVSSv3, others may be added.
/// This is impact type information (e.g. a text description, CVSSv2, CVSSv3, CVSSv4, etc.). Must contain: At least one entry, can be text, CVSSv2, CVSSv3, others may be added.
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Metric {
Expand All @@ -162,6 +162,10 @@ pub struct Metric {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub scenarios: Vec<Scenario>,

#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(rename = "cvssV4_0")]
pub cvss_v4_0: Option<Value>,

#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(rename = "cvssV3_1")]
pub cvss_v3_1: Option<Value>,
Expand Down
Loading