-
Notifications
You must be signed in to change notification settings - Fork 79
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
Added CVSSv4 support #166
Added CVSSv4 support #166
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,7 +289,8 @@ | |
"type": "string", | ||
"enum": [ | ||
"CVSS_V2", | ||
"CVSS_V3" | ||
"CVSS_V3", | ||
"CVSS_V4" | ||
] | ||
}, | ||
"score": { | ||
|
@@ -328,6 +329,22 @@ | |
} | ||
} | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"properties": { | ||
"type": { | ||
"const": "CVSS_V4" | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"score": { | ||
"pattern": "CVSS:4\\.[0-9]\\/AV:[NALP]\\/AC:[LH]\\/AT:[NP]\\/PR:[NLH]\\/UI:[NPA](\\/VC:[HLN]\\/VI:[HLN]\\/VA:[HLN]\\/SC:[HLN]\\/SI:[HLN]\\/SA:[HLN])?\\/S:[XNP]\\/AU:[XNY]\\/R:[XAUI]\\/V:[XDC]\\/RE:[XLMH]\\/U:[XCGAR]\\/MAV:[XNALP]\\/MAC:[XLH]\\/MAT:[XNP]\\/MPR:[XNLH]\\/MUI:[XNPA]\\/MVC:[XHLN]\\/MVI:[XHLN]\\/MVA:[XHLN]\\/MSC:[XHLN]\\/MSI:[XSHLN]\\/MSA:[XSHLN]\\/CR:[XHML]\\/IR:[XHML]\\/AR:[XHML]\\/E:[XAPU]" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment re ordering here. We also need to make sure the metrics listed as optional in the spec are actually optional here (per table 23 in https://www.first.org/cvss/v4.0/specification-document). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I recommend using the official regular expression that is fully compliant with the specification here. |
||
} | ||
} | ||
} | ||
} | ||
], | ||
"required": [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question:
https://www.first.org/cvss/v4.0/specification-document states:
"A vector string must contain metrics in the order shown in Table 23, every other ordering is invalid. All Base metrics must be included in a vector string."
The example vector string here doesn't seem to follow the order in table 23 of the spec. e.g. "Exploit Maturity (E)" is listed in the middle of the table, but is the last metric in the example vector string.
Am I reading the spec correctly here?
This seems different from CVSS 3.x (which states "A vector string should contain metrics in the order shown in Table 15, though other orderings are valid."). We had to remove our regex validation because of that (#168).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the reason you pointed out, we had to change the fixed ordering rule. Indeed, building a CVSS v4.0-compliant regular expression imply testing O(n!) combinations, and with 32 unique metrics... The regex would be Terrabytes long 😅
The documented CVSS v4.0 vector/string representation here is invalid as the group order is BTES, not BSTE. The valid vector must be
CVSS:4.0/AV:A/AC:H/AT:P/PR:L/UI:P/VC:N/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
.