Fix CVSS4 clean vector field ordering - Threat and Environmental metrics generate invalid vectors#72
Merged
superbuggy merged 1 commit intoRedHatProductSecurity:masterfrom Mar 26, 2025
Conversation
superbuggy
reviewed
Mar 20, 2025
Collaborator
superbuggy
left a comment
There was a problem hiding this comment.
At first pass this looks good; it may be worth citing the spec source URL in a code comment, as well. Thank you for your contribution!
Fix CVSS4 vectors generated by this module to follow the ordering from the specifications[1]. Before this change all vectors with Threat and Environmental metrics would be invalid and rejected by other CVSS tools[2]. [1] https://www.first.org/cvss/v4-0/specification-document#Vector-String [2] https://redhatproductsecurity.github.io/cvss-v4-calculator/
b7df6b9 to
ae6d3f8
Compare
Contributor
Author
|
@superbuggy I've added comments to the constants4 module and clean_vector function to point out the significance of the field ordering. |
Collaborator
|
@superbuggy , looks good now? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix CVSS4 vectors generated by this module to follow the ordering from the specifications[1]. Before this change all vectors with Threat and Environmental metrics would be invalid and rejected by other CVSS tools[2].
[1] https://www.first.org/cvss/v4-0/specification-document#Vector-String
[2] https://redhatproductsecurity.github.io/cvss-v4-calculator/
This is related to #66 but does not add input validation because the doc strings explicitly mention that fields may be out of order. I've updated the ordering of the other metrics lists in sync with the specification too.