-
Notifications
You must be signed in to change notification settings - Fork 24
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
CVE JSON Validation failure of certain CVSS 4 scores #87
Comments
The issue has a solution here: python-jsonschema/jsonschema#1274 (comment) The solution is to load json files with parse_float=decimal.Decimal |
Float value in the json schema are used in arithmetic division. They must be loaded as decimal or comparison will fail. see RedHatProductSecurity#87
Deep down, the error boils to cvss v4 base Score comparison to being a multiple of 0.1 :
This fails the verification (L174) that int(70.9999..) == 70.9999... |
On Apr 18 2024 , CVEProject/cve-schema seems to have partially fixed/avoided this problem by changing the cvssv4 schema scoreType to list all decimal values, instead of using multipleOf Conclusion: There is a new json schema for cvss v4 https://github.com/CVEProject/cve-schema/blob/84a2b1ed8bf98218a822843e06236c1e91cae0f8/schema/imports/cvss/cvss-v4.0.json that also fixes this problem by removing the usage of multipleOf, therefore avoiding the "float bug" https://github.com/CVEProject/cve-schema/releases/tag/v5.1.0 |
Updated to the latest schema files in the linked PR; the 5.1.0 schema that was included in cvelib was I guess still the RC version. I tested the record attached here against the newer schema and it validates correctly. |
@mprpic would it be possible to has a minor release (pypi) with this fix ? |
The attached file was generated with vulnogram.github.io
CVE-0000-1234.json
cvelib fails when trying to validate that file.
A deep dive seems to point to a failure in the jsonschema dependency ( see python-jsonschema/jsonschema#1274 ) , where jsonschema fails to validate a number in a range.
The error comes back as "7.1 is not a multiple of 0.1"
The text was updated successfully, but these errors were encountered: