GHSA-xhr8-mpwq-2rr2:
Automatic named constructor discovery in Valinor
N/A
CVSS Score
Basic Information
CVE ID
-
GHSA ID
EPSS Score
-
CWE
-
Published
4/1/2022
Updated
1/11/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
-
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
cuyz/valinor | composer | >= 0.5.0, < 0.7.0 | 0.7.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from automatic named constructor resolution introduced in commit 718d3c1. The ConstructorObjectBuilderFactory
handles this resolution by:
findConstructors()
gathering all public static methods with parameters that return the class instance (including dangerous ones likefromDb
)for()
selecting the 'best match' constructor based on input keys. This automatic discovery allows attackers to invoke unintended constructors by matching parameter names in their payload. The patch in 0.7.0 requires explicit constructor registration, confirming these functions were the root cause.