-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: add CVSSv4 support to auditjs parser and improve error handling #12391
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
fix: add CVSSv4 support to auditjs parser and improve error handling #12391
Conversation
|
This pull request addresses potential security vulnerabilities including DOMPurify XSS issues, a high-severity MySQL certificate verification vulnerability, and modifications to CVSS parsing and testing in the AuditJS parser, with associated updates to test cases and dependency handling. 💭 Unconfirmed Findings (6)
All finding details can be found in the DryRun Security Dashboard. |
|
Thank you for the PR. Can you look at my comment, the linting errors and rebase against the |
…shev77/django-DefectDojo into fix/auditjs-cvss4-support
|
Thanks, I've updated the base branch here on the GitHub PR as well. Could you look at providing/updating a test case that covers the new CVSS code? |
|
Sure, I’ll take a look at the test file next week and may extend it with additional scan examples to cover CVSS v2 and v4 cases. |
|
I've added new tests for CVSS V2 and V4 vectors and updated the scan examples. However, to run the tests properly, it's necessary to manually add the updated parse_cvss_from_text function to the auditjs parser (for now). |
|
Thanks! I've approved the workflows to run, can you look at the test failure: https://github.com/DefectDojo/django-DefectDojo/actions/runs/15003307072/job/42158252920?pr=12391#step:8:3482 |
|
Yes, this error occurs due to missing functionality in the CVSS library. So, we're waiting for updates. |
valentijnscholten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Haralishev77 I think it would be fine if you add some extra code to handle the CVSS4 case, i.e. mimic what your upstream PR does. I am saying this because it looks like it might take a while before RedHat will release a version with your fix/enhancement. And soon we will add CVSS4 support to Defect Dojo and that will be a point where we will double check all CVSS related code in parsers and could cleanup the extra code.
|
Okay, I’ll push the changes soon. |
valentijnscholten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, feel free to take it out of draft.
mtesauro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
…efectDojo#12391) * fix: add CVSSv4 support to auditjs parser and improve error handling * fix: add CVSSv4 support to auditjs parser and improve error handling * lint: fix exception style, add CVSS4.0 vector to description * tests: Add tests for CVSS V2 and V4 vectors and update scan examples * docs: Correct comment text * temp: add local parse_cvss_from_text until upstream PR is merged * docs: fix docstring formatting to comply with D413 * Update dojo/tools/auditjs/parser.py * Update dojo/tools/auditjs/parser.py --------- Co-authored-by: valentijnscholten <[email protected]>
Summary
This PR adds CVSS v4 support to the AuditJS parser in DefectDojo.
Changes
CVSS:4.0vectors using theCVSS4class.Note
Support for CVSS4 relies on RedHatProductSecurity/cvss#75 being merged and released (likely in version
3.5).Once it's available, the
requirements.txtshould be updated accordingly.