TimothyHarder / CVSS-Calculator

Making this project for fun, and because I wanted to learn more about the metrics and calculations that go into this score.
GNU General Public License v2.0
1 stars 0 forks source link

Environmental metrics with default values not working #1

Open TimothyHarder opened 3 years ago

TimothyHarder commented 3 years ago

Environmental metrics with the value of "X" are not working correctly. Working on a fix.

TimothyHarder commented 3 years ago

To replicate the problem:

base_metrics = { "AV": "N", "AC": "L", "PR": "L", "UI": "N", "S": "C", "C": "H", "I": "H", "A": "H", }

temporal_metrics = { "E": "P", "RL": "O", "RC": "C", }

environmental_metrics = { "CR": "X", "IR": "X", "AR": "X", "MAV": "X", "MAC": "X", "MPR": "X", "MUI": "X", "MS": "X", "MC": "X", "MI": "X", "MA": "X", }

You get the output of: Base Score: 9.9 Temporal Score: 8.9 Environmental Score: 8.1

Vector String: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C

It should be: Base Score: 9.9 Temporal Score: 8.9 Environmental Score: 9.0

Vector String: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C