Skip to content

Commit acd2b89

Browse files
committed
fix: Avoid FPs when Composer product name has php
Previously, only PHP package's vendor (product URL's namespace) was considered as evidence. As of DependencyCheck v12, specifically change from b51921f, the product (name) is also being considered as evidence. This results in new false positives. PHP Composer checks are affected, for example, considering package `pkg:composer/phpunit/[email protected]` as `cpe:2.3:a:php:php:6.0:*:*:*:*:*:*:*` resulting in 17 CVEs (including Critical). This commit adds two new suppression rules: one for php as the prefix, and one for php as the suffix. Both can be observed in the wild. Additionally, underscore is sometimes used instead of hyphen, and should be respected. Furthermore, there is `symfony/polyfill-php83` which adds number suffix, which should also be suppressed as it currently maps to the base `cpe:/a:php:php`.
1 parent 80a7e7e commit acd2b89

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

core/src/main/resources/dependencycheck-base-suppression.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,28 @@
361361
<suppress base="true">
362362
<notes><![CDATA[
363363
FP per #2972
364+
hyphenated PHP library vendor names
364365
]]></notes>
365366
<packageUrl regex="true">^pkg:composer/php\-.*$</packageUrl>
366367
<cpe>cpe:/a:php:php</cpe>
367368
</suppress>
369+
<suppress base="true">
370+
<notes><![CDATA[
371+
FP per #2972 + #7444
372+
hyphenated PHP library product names (prefix)
373+
]]></notes>
374+
<packageUrl regex="true">^pkg:composer/[^/]+/php[\-_].*$</packageUrl>
375+
<cpe>cpe:/a:php:php</cpe>
376+
</suppress>
377+
<suppress base="true">
378+
<notes><![CDATA[
379+
FP per #2972 + #7444
380+
hyphenated PHP library product names (suffix)
381+
including number suffix, e.g., `symfony/polyfill-php80`
382+
]]></notes>
383+
<packageUrl regex="true">^pkg:composer/[^/]+/.*[\-_]php[0-9]*@.*$</packageUrl>
384+
<cpe>cpe:/a:php:php</cpe>
385+
</suppress>
368386
<suppress base="true">
369387
<notes><![CDATA[
370388
FP per #2957

0 commit comments

Comments
 (0)