Miggo Logo

CVE-2024-4990:
Unsafe Reflection in base Component class in yiisoft/yii2

8.1

CVSS Score

Basic Information

EPSS Score
-
Published
6/2/2024
Updated
7/31/2024
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
yiisoft/yii2composer< 2.0.49.42.0.49.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the __set() method in Component.php handling behavior attachment. The unpatched code (L191) directly used Yii::createObject($value) without validating if $value represents a valid Behavior class. The commit diff shows added checks (is_subclass_of) to restrict instantiation to Behavior subclasses, confirming this was the vulnerable entry point. The function's role in dynamic object creation with user-controlled input makes it the clear vulnerability source.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

Yii* supports *tt***in* ****viors to *ompon*nts *y s*ttin* prop*rti*s **vin* t** *orm*t `'*s <****viour-n*m*>'`. Int*rn*lly t*is is *on* usin* t** `__s*t()` m**i* m*t*o*. I* t** v*lu* p*ss** to t*is m*t*o* is not *n inst*n** o* t** `****vior` *l*ss,

Reasoning

T** vuln*r**ility st*ms *rom t** __s*t() m*t*o* in *ompon*nt.p*p **n*lin* ****vior *tt***m*nt. T** unp*t**** *o** (L***) *ir**tly us** Yii::*r**t*O*j**t($v*lu*) wit*out v*li**tin* i* $v*lu* r*pr*s*nts * v*li* ****vior *l*ss. T** *ommit *i** s*ows ***