Jan 7, 2026·7 min read·32 visits
Yii 2 failed to validate the `__class` key when attaching behaviors to components. Attackers bypass security checks by providing a valid `class` to satisfy the validator, while sneaking in a malicious `__class` that the object factory prioritizes. This allows for arbitrary object instantiation (RCE), notably exploited in the wild against Craft CMS.
A critical remote code execution vulnerability in the Yii 2 framework caused by a logic disparity between input validation and object instantiation. By exploiting the precedence of the `__class` key over the validated `class` key, attackers can instantiate arbitrary PHP classes, leading to full system compromise.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
Yii Framework YiiSoftware | < 2.0.52 | 2.0.52 |
Craft CMS Pixel & Tonic | < 4.4.15 | 4.4.15 |
| Attribute | Detail |
|---|---|
| Attack Vector | Network (HTTP POST) |
| CVSS v3.1 | 9.0 (Critical) |
| CWE | CWE-424 (Improper Protection of Alternate Path) |
| EPSS Score | 78.44% |
| Exploit Status | Active Exploitation / Weaponized |
| Gadgets | GuzzleHttp\Psr7\FnStream, yii\rbac\PhpManager |
The application does not verify that the execution flow takes the expected path, allowing an attacker to bypass authentication or validation checks.