Miggo Logo

GHSA-xhr8-mpwq-2rr2:
Automatic named constructor discovery in Valinor

N/A

CVSS Score

Basic Information

CVE ID
-
EPSS Score
-
CWE
-
Published
4/1/2022
Updated
1/11/2023
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
cuyz/valinorcomposer>= 0.5.0, < 0.7.00.7.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from automatic named constructor resolution introduced in commit 718d3c1. The ConstructorObjectBuilderFactory handles this resolution by:

  1. findConstructors() gathering all public static methods with parameters that return the class instance (including dangerous ones like fromDb)
  2. 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

## **si*n issu* - *utom*ti* *onstru*tor *is*ov*ry T** issu* *ris*s w**n up*r**in* *rom `*uyz/v*linor:*.*.*` to * n*w*r syst*m on *n *xistin* *ppli**tion, w*i** *rok* *u* to t** wron* *onstru*tor **in* pi*k**. Still, * *i***r s**urity *on**rn is pro

Reasoning

T** vuln*r**ility st*ms *rom *utom*ti* n*m** *onstru*tor r*solution intro*u*** in *ommit *******. T** `*onstru*torO*j**t*uil**r***tory` **n*l*s t*is r*solution *y: *. `*in**onstru*tors()` **t**rin* *ll pu*li* st*ti* m*t*o*s wit* p*r*m*t*rs t**t r*tu