Skip to content

fix(fp): Fix more common false positives for popular PHP/composer frameworks with generic names#7994

Merged
jeremylong merged 3 commits intodependency-check:mainfrom
chadlwilson:fix-composer-fps
Oct 6, 2025
Merged

fix(fp): Fix more common false positives for popular PHP/composer frameworks with generic names#7994
jeremylong merged 3 commits intodependency-check:mainfrom
chadlwilson:fix-composer-fps

Conversation

@chadlwilson
Copy link
Copy Markdown
Collaborator

@chadlwilson chadlwilson commented Oct 1, 2025

Description of Change

As discussed in #7984 there are a large number of FPs for common PHP frameworks/libs right now due to the vendor name being commonly part of the package, and individual modules often being independently versioned.

Most major frameworks appear to have different CPEs for the additional modules within NVD, so this should be low risk.

This builds upon and extends #7543. Should address most FPs from composer packages for

Related issues

Have test cases been added to cover the new functionality?

no - regexes tested via https://regexr.com/ and manually tested with ODC by @GALHP

@boring-cyborg boring-cyborg Bot added the core changes to core label Oct 1, 2025
@chadlwilson

This comment was marked as resolved.

Comment thread core/src/main/resources/dependencycheck-base-suppression.xml Outdated
@GALHP
Copy link
Copy Markdown

GALHP commented Oct 2, 2025

Does this look like it catches most of them @GALHP? I haven't done every single one, just focused on the big named frameworks for now.

@chadlwilson thanks for your PR 🙏

I ran it locally and in example case of #7984 it reduced 1040 findings across 35 dependencies to 36 findings across 14 dependencies (30 findings across 13 dependencies with the suggestion).

@chadlwilson

This comment was marked as resolved.

@GALHP
Copy link
Copy Markdown

GALHP commented Oct 2, 2025

Are you able to share the remaining findings? I'll see if it's as expected or whether I can clean up more.

Sure, here are remaining packages grouped by CPEs (my suggestion already included)

Package IDs grouped by CPE

packageIdsGroupedByVulnerabilityId.json

{
  "cpe:2.3:a:authenticator:authenticator:7.6.0:*:*:*:*:*:*:*": [
    "pkg:composer/scheb/[email protected]"
  ],
  "cpe:2.3:a:authenticator_project:authenticator:7.6.0:*:*:*:*:*:*:*": [
    "pkg:composer/scheb/[email protected]"
  ],
  "cpe:2.3:a:archive_project:archive:1.5.0:*:*:*:*:*:*:*": [
    "pkg:composer/pear/[email protected]"
  ],
  "cpe:2.3:a:tar_project:tar:1.5.0:*:*:*:*:*:*:*": [
    "pkg:composer/pear/[email protected]"
  ],
  "cpe:2.3:a:lookup:lookup:3.0.0:*:*:*:*:*:*:*": [
    "pkg:composer/sebastian/[email protected]"
  ],
  "cpe:2.3:a:file_project:file:1.0.4:*:*:*:*:*:*:*": [
    "pkg:composer/pimcore/[email protected]"
  ],
  "cpe:2.3:a:finder_project:finder:6.4.24:*:*:*:*:*:*:*": [
    "pkg:composer/symfony/[email protected]"
  ],
  "cpe:2.3:a:htmlsanitizer_project:htmlsanitizer:6.4.18:*:*:*:*:*:*:*": [
    "pkg:composer/symfony/[email protected]"
  ],
  "cpe:2.3:a:newsletter:newsletter:1.2.0:*:*:*:*:*:*:*": [
    "pkg:composer/pimcore/[email protected]"
  ],
  "cpe:2.3:a:newsletter_project:newsletter:1.2.0:*:*:*:*:*:*:*": [
    "pkg:composer/pimcore/[email protected]"
  ],
  "cpe:2.3:a:pear:pear:1.10.16:*:*:*:*:*:*:*": [
    "pkg:composer/pear/[email protected]"
  ],
  "cpe:2.3:a:git-php_project:git-php:1.0.3:*:*:*:*:*:*:*": [
    "pkg:composer/gal-digital-gmbh/[email protected]"
  ],
  "cpe:2.3:a:file_project:file:4.1.0:*:*:*:*:*:*:*": [
    "pkg:composer/phpunit/[email protected]"
  ],
  "cpe:2.3:a:php-proxy:php-proxy:1.0.18:*:*:*:*:*:*:*": [
    "pkg:composer/friendsofphp/[email protected]"
  ],
  "cpe:2.3:a:sitemap_project:sitemap:2.0.1:*:*:*:*:*:*:*": [
    "pkg:composer/gal-digital-gmbh/[email protected]"
  ],
  "cpe:2.3:a:sitemap_project:sitemap:4.1.3:*:*:*:*:*:*:*": [
    "pkg:composer/presta/[email protected]"
  ]
}

@chadlwilson
Copy link
Copy Markdown
Collaborator Author

chadlwilson commented Oct 2, 2025

OK, all but one of those are separate so I'll probably leave them for now. Feel free to suggest a PR to suppress them. You'll see some existing suppressions for the various _project type of CPEs.

  "cpe:2.3:a:pear:pear:1.10.16:*:*:*:*:*:*:*": [
    "pkg:composer/pear/[email protected]"
  ],

I am not sure if I agree that this is a false positive - and I intentionally excluded it from the suppressions. Since it is released and versioned alongside pear/pear, even though it is a minimal variant, it still may be subject to vulnerabilities in Pear, no? (PEAR.php, System.php, ErrorStack.php)

https://github.com/pear/pear-core-minimal
https://packagist.org/packages/pear/pear-core-minimal

It may indeed lead to false positives for some vulns affecting non minimal pieces. Unless the minimal variant is managed with a different CPE I'm not sure we can safely suppress this for all CVEs.

@GALHP
Copy link
Copy Markdown

GALHP commented Oct 2, 2025

I am not sure if I agree that this is a false positive - and I intentionally excluded it from the suppressions. Since it is released and versioned alongside pear/pear, even though it is a minimal variant, it still may be subject to vulnerabilities in Pear, no? (PEAR.php, System.php, ErrorStack.php)

I agree with you that this should be decided based on the underlying vulnerability.

@jeremylong jeremylong merged commit edd1491 into dependency-check:main Oct 6, 2025
5 checks passed
@chadlwilson chadlwilson deleted the fix-composer-fps branch October 6, 2025 14:09
@jeremylong jeremylong added this to the 12.1.7 milestone Oct 12, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

core changes to core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

High number of false positives in Composer Lock Analyzer after PR #7295

3 participants