Yii 2 Behavior Validation Bypass via __class
CVE-2024-58136 is an improper protection of alternate path vulnerability in Yii 2 versions before 2.0.52 and a regression of the fix for CVE-2024-4990. During behavior attachment, validation checks the class configuration key, whereas Yii::createObject() prioritizes __class. An attacker can supply a legitimate Behavior subclass under class while selecting an arbitrary available class under __class, bypassing the intended restriction. Constructor or destructor gadgets can turn this arbitrary class instantiation into code execution or blind server-side request forgery. The vulnerability was exploited alongside CVE-2025-32432 in Craft CMS from February through April 2025.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation permits arbitrary instantiation of available PHP classes and invocation of their constructor or destructor logic. Demonstrated outcomes include server-side PHP and shell-command execution and blind server-side request forgery. In the observed Craft CMS exploitation chain, attackers deployed PHP-based file managers and backdoors, exfiltrated data, and overwrote legitimate files, sometimes taking websites offline. These outcomes depend on the application's exposed configuration paths and available gadgets.
If you can’t patch tonight, do this now.
Block malicious requests targeting the Craft CMS image transformation functionality and monitor application, web server, firewall, and security-device logs for suspicious POST requests containing __class or behavior configuration fields beginning with 'as'. If compromise is suspected, refresh application security keys, rotate database and other service credentials and private keys, and force user password resets. The Craft CMS application patch mitigates the documented entry point but does not replace remediation of the underlying Yii vulnerability.
Patch, then assume compromise.
Upgrade Yii 2 to version 2.0.52 or later. For affected Craft CMS deployments, upgrade to version 3.9.15, 4.14.15, 5.6.17, or later to address CVE-2025-32432 and block the documented attack chain. Those Craft CMS fixes did not necessarily upgrade the bundled Yii framework, so verify the installed Yii version separately. Patching does not remove existing attacker-installed files; investigate suspected compromises, verify application and database integrity, remove unauthorized modifications, and rotate affected credentials and cryptographic material.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
33 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.