fix(fp): convert hosted/generated suppressions to conservative regex prefix matchers#8522
Conversation
…prefix matchers Unfortunately, dependency-check#8510 caused some suppressions to regress, since the trailing bits of the CPE are removed for vulnerabilities without versions in them and the existing code does not normalise the CPE URI from the suppressions. This means vulns with affected versions like `cpe:2.3:a:vaadin:vaadin:*:*:*:*:*:*` will no longer match as they are normalized to `cpe:/a:vaadin:vaadin` without a trailing `:` Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
|
Sorry forgot to tag @nhumblot for feedback 🙏🏻 We might get a swathe of FP reports today because of my mistake here. I'll handle them if so. |
fd39162
into
dependency-check:generatedSuppressions
|
Sorry for the hassle. 😓 |
|
@jeremylong unfortunately #8516 didn’t seem to lead to the publish workflow being triggered. would you be able to trigger the workflow manually for now so we can get the fix out? |
|
Hello, Since the new way of handling the packageUrl with regex, the matching seems to be incrorrect. The package "pkg:maven/org.hibernate.validator/hibernate-validator@8.0.2.Final" should be matched by the following suppression in the generatedSuppression file: Yet, the CVE-2025-15104 still fails the check. The packageUrl regex changed from Other package url doesnt seem to be touched (I didnt check each of them though). Reading the comment on this issue and the linked one, I don't know why pkgUrl matching changed as the topic seems to be around cpe matching. Is it an oversight ?
|
|
See #8525 for the fix (already linked above) - apologies for the hassle. |
|
None of these suppression rules have any automated tests whatsoever, so occasionally screw ups will happen, unfortunately (including systemic issues such as the widespread false negatives that this PR and #8510 are attempting to fix for the |
|
Copilot would probably have caught this, but I forgot to ask it for review. Oops. |
|
Right ! Have not seen that, thanks a lot :) |
Description of Change
As discovered myself in #8521 (comment) unfortunately my change in #8510 caused some unintentional regression of suppression applicability for hosted suppressions, since the trailing bits of the CPE are removed for vulnerabilities without versions in them (typically ones with startsWith/endsWith ranges at NVD such as https://nvd.nist.gov/vuln/detail/CVE-2025-15104)
The existing code does not normalise the suppression rule CPE URI from the suppressions before comparing the string representation prefix. This means vulns with affected versions like
cpe:2.3:a:validator:validator:*:*:*:*:*:*will no longer match as they are correctly normalized by the code tocpe:/a:validator:validatorwithout a trailing:before matching to the prefix rule. I'd forgotten about this CPE 2.2 vs 2.3 difference :-(This change converts them to regexes - so it's possible to express the matching across ODC versions. An alternative would be to just revert things and leave the false negative possibilities.
Related issues
Have test cases been added to cover the new functionality?
no