Skip to content

commonlib: Add test to verify all vulnerabilities have solutions#7467

Open
Flintstqne wants to merge 1 commit into
zaproxy:mainfrom
Flintstqne:check-vuln-solutions-8056
Open

commonlib: Add test to verify all vulnerabilities have solutions#7467
Flintstqne wants to merge 1 commit into
zaproxy:mainfrom
Flintstqne:check-vuln-solutions-8056

Conversation

@Flintstqne

@Flintstqne Flintstqne commented Jun 18, 2026

Copy link
Copy Markdown

Summary

All 52 entries in vulnerabilities.xml already 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

  • Added shouldHaveSolutionsForAllDefaultVulnerabilities() to DefaultVulnerabilitiesUnitTest

Test plan

  • New test passes: ./gradlew :addOns:commonlib:test --tests "org.zaproxy.addon.commonlib.internal.vulns.DefaultVulnerabilitiesUnitTest"
  • Existing tests unaffected

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>
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Flintstqne

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@psiinon

psiinon commented Jun 18, 2026

Copy link
Copy Markdown
Member

Logo
Checkmarx One – Scan Summary & Details6f94c0f1-52da-4196-b9d9-d501d2b52b56

Great job! No new security vulnerabilities introduced in this pull request


Use @Checkmarx to interact with Checkmarx PR Assistant.
Examples:
@Checkmarx how are you able to help me?
@Checkmarx rescan this PR

@thc202

thc202 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Removed the close of the issue, that should be done when a last pass is done reviewing all solutions are appropriate.

}

@Test
void shouldHaveSolutionsForAllDefaultVulnerabilities() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better check all main properties like in the previous method (extract one from there) rather than one off for the solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants