Repository navigation
Composer: patch releases such as 2.4.6-p1 are ordered before the release, so Magento advisories are missed
#11626
Closed
luiacuaniello
started this conversation in
False Detection
Replies: 1 comment
|
Hello @luiacuaniello Created #11630. Regards, Dmitriy |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
IDs
CVE-2024-34102
Description
Trivy compares Composer versions with the generic SemVer comparer (
compare.GenericComparerinpkg/detector/library/driver.go), but Composer does not order versions the way SemVer does. The difference that matters most is the patch stability: Composer orders2.4.6-p1after2.4.6, while SemVer reads-p1as a pre-release that comes before2.4.6.Adobe ships Magento security fixes as patch releases (
2.4.6-p6,2.4.7-p1), so the advisories are written in terms of them. For CVE-2024-34102 (CosmicSting, critical), the PHP Security Advisories Database lists these ranges formagento/product-community-edition:Scanning a
composer.lockwithmagento/product-community-editionat each version gives:The second column is the answer of
composer/semver3.6.0 (Semver::satisfies) for the same ranges.Scope. 315 Composer advisories in the current DB have a patch release as a bound: 254 for
magento/community-edition, 56 formagento/product-community-edition, 3 forec-cube/ec-cube, and one each forphpbb/phpbbandphpmyadmin/phpmyadmin.The SemVer comparison differs from Composer in two more ways:
2.0.0-RC1sorts before2.0.0-beta1, andbeta10beforebeta2.2.10.RC1,v7.0.0_rc1,V0.7.5,6.0.0.alpha.1. When such a version is a bound, the advisory never matches.statamic/cmsCVE-2026-33885 has the ranges<5.73.16and>=6.0.0.alpha.1, <6.7.2, and Trivy reports it for no version.Measured on real versions. I took every version published on Packagist for the packages that have advisories (1,034 of them are on Packagist) and checked each against the advisories of its package: 2,152,412 pairs. Compared with Composer's version order (
VersionParser::normalizeandversion_compare, fromcomposer/semver3.6.0), Trivy misses 2,560 pairs in 33 packages and reports 3,530 pairs that are outside the ranges in 13 packages.I have a fix ready: a comparer for Composer that follows
VersionParser::normalizeand PHP'sversion_compare. It gives the same answer ascomposer/semveron all of those pairs. The PR is #11627.Reproduction Steps
Target
Filesystem
Scanner
Vulnerability
Target OS
No response
Debug Output
Version
$ trivy --version Version: dev Vulnerability DB: Version: 2 UpdatedAt: 2026-11-10 19:01:23.081219346 +0000 UTC NextUpdate: 2026-11-11 19:01:23.081218965 +0000 UTC DownloadedAt: 2026-11-11 09:53:50.103626 +0000 UTC # Built from main at a2a154d75.Checklist
-f jsonthat shows data sources and confirmed that the security advisory in data sources was correctAll reactions