commonlib: Add test to verify all vulnerabilities have solutions#7467
Open
Flintstqne wants to merge 1 commit into
Open
commonlib: Add test to verify all vulnerabilities have solutions#7467Flintstqne wants to merge 1 commit into
Flintstqne wants to merge 1 commit into
Conversation
Ensure no vulnerability entry can be added to vulnerabilities.xml without a non-empty solution, closing the gap raised in issue zaproxy/zaproxy#8056. Signed-off-by: Flintstqne <braydenumberger06@gmail.com>
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Member
|
Great job! No new security vulnerabilities introduced in this pull requestUse @Checkmarx to interact with Checkmarx PR Assistant. |
Member
|
Removed the close of the issue, that should be done when a last pass is done reviewing all solutions are appropriate. |
thc202
reviewed
Jun 18, 2026
| } | ||
|
|
||
| @Test | ||
| void shouldHaveSolutionsForAllDefaultVulnerabilities() { |
Member
There was a problem hiding this comment.
Better check all main properties like in the previous method (extract one from there) rather than one off for the solutions.
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.

Summary
All 52 entries in
vulnerabilities.xmlalready have<solution>content, but the existing unit test only spot-checks 3 of them (wasc_1, wasc_13, wasc_49). This adds a test that iterates over all vulnerabilities and asserts each has a non-empty solution, preventing future regressions where a new entry could be added without one.Changes
shouldHaveSolutionsForAllDefaultVulnerabilities()toDefaultVulnerabilitiesUnitTestTest plan
./gradlew :addOns:commonlib:test --tests "org.zaproxy.addon.commonlib.internal.vulns.DefaultVulnerabilitiesUnitTest"