Skip to content

Commit

Permalink
cvss 4.0 calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
miko37x committed May 7, 2024
1 parent 840bcac commit 97750f0
Show file tree
Hide file tree
Showing 4 changed files with 815 additions and 215 deletions.
370 changes: 180 additions & 190 deletions lib/cvss_4_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,6 @@ export const definitions = {
]
};

// Copyright FIRST, Red Hat, and contributors
// SPDX-License-Identifier: BSD-2-Clause

export const cvssLookup_global = {
"000000": 10,
"000001": 9.9,
Expand Down Expand Up @@ -471,191 +468,188 @@ export const cvssLookup_global = {
"012201": 6.3,
"012211": 2.9,
"012221": 1.7,
100000: 9.8,
100001: 9.5,
100010: 9.4,
100011: 8.7,
100020: 9.1,
100021: 8.1,
100100: 9.4,
100101: 8.9,
100110: 8.6,
100111: 7.4,
100120: 7.7,
100121: 6.4,
100200: 8.7,
100201: 7.5,
100210: 7.4,
100211: 6.3,
100220: 6.3,
100221: 4.9,
101000: 9.4,
101001: 8.9,
101010: 8.8,
101011: 7.7,
101020: 7.6,
101021: 6.7,
101100: 8.6,
101101: 7.6,
101110: 7.4,
101111: 5.8,
101120: 5.9,
101121: 5,
101200: 7.2,
101201: 5.7,
101210: 5.7,
101211: 5.2,
101220: 5.2,
101221: 2.5,
102001: 8.3,
102011: 7,
102021: 5.4,
102101: 6.5,
102111: 5.8,
102121: 2.6,
102201: 5.3,
102211: 2.1,
102221: 1.3,
110000: 9.5,
110001: 9,
110010: 8.8,
110011: 7.6,
110020: 7.6,
110021: 7,
110100: 9,
110101: 7.7,
110110: 7.5,
110111: 6.2,
110120: 6.1,
110121: 5.3,
110200: 7.7,
110201: 6.6,
110210: 6.8,
110211: 5.9,
110220: 5.2,
110221: 3,
111000: 8.9,
111001: 7.8,
111010: 7.6,
111011: 6.7,
111020: 6.2,
111021: 5.8,
111100: 7.4,
111101: 5.9,
111110: 5.7,
111111: 5.7,
111120: 4.7,
111121: 2.3,
111200: 6.1,
111201: 5.2,
111210: 5.7,
111211: 2.9,
111220: 2.4,
111221: 1.6,
112001: 7.1,
112011: 5.9,
112021: 3,
112101: 5.8,
112111: 2.6,
112121: 1.5,
112201: 2.3,
112211: 1.3,
112221: 0.6,
200000: 9.3,
200001: 8.7,
200010: 8.6,
200011: 7.2,
200020: 7.5,
200021: 5.8,
200100: 8.6,
200101: 7.4,
200110: 7.4,
200111: 6.1,
200120: 5.6,
200121: 3.4,
200200: 7,
200201: 5.4,
200210: 5.2,
200211: 4,
200220: 4,
200221: 2.2,
201000: 8.5,
201001: 7.5,
201010: 7.4,
201011: 5.5,
201020: 6.2,
201021: 5.1,
201100: 7.2,
201101: 5.7,
201110: 5.5,
201111: 4.1,
201120: 4.6,
201121: 1.9,
201200: 5.3,
201201: 3.6,
201210: 3.4,
201211: 1.9,
201220: 1.9,
201221: 0.8,
202001: 6.4,
202011: 5.1,
202021: 2,
202101: 4.7,
202111: 2.1,
202121: 1.1,
202201: 2.4,
202211: 0.9,
202221: 0.4,
210000: 8.8,
210001: 7.5,
210010: 7.3,
210011: 5.3,
210020: 6,
210021: 5,
210100: 7.3,
210101: 5.5,
210110: 5.9,
210111: 4,
210120: 4.1,
210121: 2,
210200: 5.4,
210201: 4.3,
210210: 4.5,
210211: 2.2,
210220: 2,
210221: 1.1,
211000: 7.5,
211001: 5.5,
211010: 5.8,
211011: 4.5,
211020: 4,
211021: 2.1,
211100: 6.1,
211101: 5.1,
211110: 4.8,
211111: 1.8,
211120: 2,
211121: 0.9,
211200: 4.6,
211201: 1.8,
211210: 1.7,
211211: 0.7,
211220: 0.8,
211221: 0.2,
212001: 5.3,
212011: 2.4,
212021: 1.4,
212101: 2.4,
212111: 1.2,
212121: 0.5,
212201: 1,
212211: 0.3,
212221: 0.1
"100000": 9.8,
"100001": 9.5,
"100010": 9.4,
"100011": 8.7,
"100020": 9.1,
"100021": 8.1,
"100100": 9.4,
"100101": 8.9,
"100110": 8.6,
"100111": 7.4,
"100120": 7.7,
"100121": 6.4,
"100200": 8.7,
"100201": 7.5,
"100210": 7.4,
"100211": 6.3,
"100220": 6.3,
"100221": 4.9,
"101000": 9.4,
"101001": 8.9,
"101010": 8.8,
"101011": 7.7,
"101020": 7.6,
"101021": 6.7,
"101100": 8.6,
"101101": 7.6,
"101110": 7.4,
"101111": 5.8,
"101120": 5.9,
"101121": 5,
"101200": 7.2,
"101201": 5.7,
"101210": 5.7,
"101211": 5.2,
"101220": 5.2,
"101221": 2.5,
"102001": 8.3,
"102011": 7,
"102021": 5.4,
"102101": 6.5,
"102111": 5.8,
"102121": 2.6,
"102201": 5.3,
"102211": 2.1,
"102221": 1.3,
"110000": 9.5,
"110001": 9,
"110010": 8.8,
"110011": 7.6,
"110020": 7.6,
"110021": 7,
"110100": 9,
"110101": 7.7,
"110110": 7.5,
"110111": 6.2,
"110120": 6.1,
"110121": 5.3,
"110200": 7.7,
"110201": 6.6,
"110210": 6.8,
"110211": 5.9,
"110220": 5.2,
"110221": 3,
"111000": 8.9,
"111001": 7.8,
"111010": 7.6,
"111011": 6.7,
"111020": 6.2,
"111021": 5.8,
"111100": 7.4,
"111101": 5.9,
"111110": 5.7,
"111111": 5.7,
"111120": 4.7,
"111121": 2.3,
"111200": 6.1,
"111201": 5.2,
"111210": 5.7,
"111211": 2.9,
"111220": 2.4,
"111221": 1.6,
"112001": 7.1,
"112011": 5.9,
"112021": 3,
"112101": 5.8,
"112111": 2.6,
"112121": 1.5,
"112201": 2.3,
"112211": 1.3,
"112221": 0.6,
"200000": 9.3,
"200001": 8.7,
"200010": 8.6,
"200011": 7.2,
"200020": 7.5,
"200021": 5.8,
"200100": 8.6,
"200101": 7.4,
"200110": 7.4,
"200111": 6.1,
"200120": 5.6,
"200121": 3.4,
"200200": 7,
"200201": 5.4,
"200210": 5.2,
"200211": 4,
"200220": 4,
"200221": 2.2,
"201000": 8.5,
"201001": 7.5,
"201010": 7.4,
"201011": 5.5,
"201020": 6.2,
"201021": 5.1,
"201100": 7.2,
"201101": 5.7,
"201110": 5.5,
"201111": 4.1,
"201120": 4.6,
"201121": 1.9,
"201200": 5.3,
"201201": 3.6,
"201210": 3.4,
"201211": 1.9,
"201220": 1.9,
"201221": 0.8,
"202001": 6.4,
"202011": 5.1,
"202021": 2,
"202101": 4.7,
"202111": 2.1,
"202121": 1.1,
"202201": 2.4,
"202211": 0.9,
"202221": 0.4,
"210000": 8.8,
"210001": 7.5,
"210010": 7.3,
"210011": 5.3,
"210020": 6,
"210021": 5,
"210100": 7.3,
"210101": 5.5,
"210110": 5.9,
"210111": 4,
"210120": 4.1,
"210121": 2,
"210200": 5.4,
"210201": 4.3,
"210210": 4.5,
"210211": 2.2,
"210220": 2,
"210221": 1.1,
"211000": 7.5,
"211001": 5.5,
"211010": 5.8,
"211011": 4.5,
"211020": 4,
"211021": 2.1,
"211100": 6.1,
"211101": 5.1,
"211110": 4.8,
"211111": 1.8,
"211120": 2,
"211121": 0.9,
"211200": 4.6,
"211201": 1.8,
"211210": 1.7,
"211211": 0.7,
"211220": 0.8,
"211221": 0.2,
"212001": 5.3,
"212011": 2.4,
"212021": 1.4,
"212101": 2.4,
"212111": 1.2,
"212121": 0.5,
"212201": 1,
"212211": 0.3,
"212221": 0.1
};

// Copyright FIRST, Red Hat, and contributors
// SPDX-License-Identifier: BSD-2-Clause

export const maxComposed = {
// EQ1
eq1: {
Expand Down Expand Up @@ -700,10 +694,6 @@ export const maxComposed = {
}
};

// Copyright FIRST, Red Hat, and contributors
// SPDX-License-Identifier: BSD-2-Clause

// max severity distances in EQs MacroVectors (+1)
export const maxSeverity = {
eq1: {
0: 1,
Expand Down
Loading

0 comments on commit 97750f0

Please sign in to comment.