-
Notifications
You must be signed in to change notification settings - Fork 30
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
CVSS4 round_away_from_zero error #60
Comments
Hi! We are aware of rounding issues caused mostly by using floats instead of In this specific case, it is because 8.45 cannot be represented correctly in
We are currently working on making sure both Javascript and Python implementations will return the same – and expected – values. We will be likely using the following:
|
We are currently in phase of testing. |
Resolved by #61 |
cvss/cvss/cvss4.py
Line 55 in e4cf69b
The round_away_from_zero function is not working correctly.
For values
round_away_from_zero(8.45, 1)
should return8.5
, but it returns8.4
. https://python-fiddle.com/saved/IKHz08xWhe4LsUnxAAezThis error leads to incorrect calculation of score for some vectors. For example, for the vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:P/CR:L/IR:L/AR:L/MAV:N/MAC:L/MAT:N/MPR:L/MUI:A/MVC:H/MVI:H/MVA:H/MSC:H/MSI:S/MSA:S/S:P/AU:Y/R:I/V:C/RE:H/U:Red
score should be8.5
and not8.4
.The text was updated successfully, but these errors were encountered: