Skip to content
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

Unexpected severity result using CVSSv4 #48

Closed
falcochu opened this issue Dec 19, 2023 · 5 comments
Closed

Unexpected severity result using CVSSv4 #48

falcochu opened this issue Dec 19, 2023 · 5 comments

Comments

@falcochu
Copy link

Thanks for the tool and adding support for CVSSv4.

Just doing some testing and got an unexpected result. Using the CVSSv4 update it was able to calculate the base score for the vector "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:L/SI:L/SA:L" as 6.9 correctly but not the correct severity.

Please see code snippet below and in the screenshot.

Actual Results:

>>> from cvss import CVSS4
>>> vector = 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:L/SI:L/SA:L'
>>> c = CVSS4(vector)
>>> print(c.as_json()['baseScore'])
6.9
>>> print(c.as_json()['baseSeverity'])
None
>>> print(c.severity)
High
>>> 

Screenshot to compare to CVSSv4 Website
cvss4-example

Expected Results:

>>> from cvss import CVSS4
>>> vector = 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:L/SI:L/SA:L'
>>> c = CVSS4(vector)
>>> print(c.as_json()['baseScore'])
6.9
>>> print(c.as_json()['baseSeverity'])
Medium
>>> print(c.severity)
Medium
>>> 
@skontar
Copy link
Collaborator

skontar commented Dec 19, 2023

@jobiewinserapck can you please have a look?

@jobiewinserapck
Copy link
Contributor

Sure thing, I'll take a look

@jobiewinserapck
Copy link
Contributor

jobiewinserapck commented Dec 19, 2023

Here's the PR: #50

I've fixed both of the issues encountered in the screenshot (details in the commit message). I've added additional tests for these too, hopefully the tests aren't getting too intense as they are currently take 3x as long for cvss4 vs cvss3

@skontar
Copy link
Collaborator

skontar commented Dec 19, 2023

@jobiewinserapck more tests++ 😄 .

@falcochu thanks for reporting the issue. Can you please check if the problem was resolved?

@falcochu
Copy link
Author

Hey @skontar and @jobiewinserapck can confirm it is working for me as expected now. Thanks so much for the quick fix and again for the tool :)

@skontar skontar closed this as completed Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants