Security Digest · Feb 13, 2025 · Vulnerability · Web framework
Yii CVE-2024-58136: Framework Flaw Behind Craft CMS RCE
Yii 2 before 2.0.52 lets crafted __class config reach object creation; chained into unauthenticated Craft CMS RCE in 2025. Upgrade Yii and Craft, then hunt.
Our verdict
Check exposure
Fixed in Yii 2.0.52 and in Craft 3.9.15, 4.14.15 and 5.6.17 since April 2025; confirm both versions, and if a Craft site sat unpatched in early 2025, look for dropped PHP files because upgrading does not remove them.
Who must act: Owners of Craft CMS 3, 4 or 5 sites below 3.9.15, 4.14.15 or 5.6.17, and teams running Yii 2 applications before 2.0.52 that pass request data into object configuration.
Who can relax: Craft Cloud customers, sites on patched Craft releases with Yii 2.0.52 or later, and Yii 3 or non-Yii PHP applications.
- Affected
- Yii 2 before 2.0.52
Craft CMS 3.x before 3.9.15, 4.x before 4.14.15, 5.x before 5.6.17 (tracked as CVE-2025-32432) - Fixed in
- Yii 2.0.52 (Feb 13, 2025)
Craft CMS 3.9.15, 4.14.15 and 5.6.17 (Apr 10, 2025) - CVSS
- 9.8 (v3.1, NVD)
- EPSS
- 87.8% (percentile 99.8)
- CISA KEV
- Yes, listed as known exploited
- Exploitation
- Exploited in the wild
- Severity
- Critical
What to do
- Run composer show yiisoft/yii2 and composer show craftcms/cms in each project and confirm Yii 2.0.52+ and a patched Craft release.
- Upgrade Craft and its plugins to current releases; Craft's later releases also fix the separately exploited CVE-2024-56145 and CVE-2025-35939.
- Until upgraded, block POST bodies to actions/assets/generate-transform that contain __class at the WAF or proxy, as Craft suggests.
- If a site ran a vulnerable Craft version in 2025, follow Craft's compromise steps: take it offline, remove backdoors, update, then rotate CRAFT_SECURITY_KEY, environment secrets and database credentials.
- For custom Yii 2 apps, audit any code that hands user-supplied arrays to Yii::createObject or component configuration.
How to check if you are affected or compromised
- Search access logs for POST requests to actions/assets/generate-transform, especially many in a row, and GET requests to admin pages carrying PHP code in the query string.
- Search Craft logs for 'Image transform cannot be created' errors and POST bodies with fields that start with 'as' or contain __class.
- Look in the web root for filemanager.php, autoload_classmap.php, wp-22.php and style.php, and inspect PHP session files for injected code.
- Check access logs for the IPs Orange Cyberdefense published, such as 103.106.66[.]123 and 172.86.113[.]137.
What happened#
CVE-2024-58136 is a flaw in Yii 2, the PHP framework underneath Craft CMS and many custom applications. The CVE record says Yii before 2.0.52 "mishandles the attaching of behavior that is defined by an __class array key." It calls this a regression of the earlier fix for CVE-2024-4990, "as exploited in the wild in February through April 2025." Yii 2.0.50 had tried to fix that issue (GHSA-cjcc-p67m-7qxm). The changelog lists the complete fix as Bug #20232 in 2.0.52, dated February 13, 2025. Yii only flagged it as a security release on April 9, in "Please upgrade to Yii 2.0.52", crediting Nicolas Bourras and Thomas Reynolds of Orange Cyberdefense. The record's own CVSS is 9.0. NVD scores it 9.8.
Orange Cyberdefense found the bug while investigating a hacked Craft CMS server. Its write-up says the attacker started around February 10, 2025, before any fix existed. The chain works like this. An unauthenticated POST to /index.php?p=admin/actions/assets/generate-transform carries a crafted object configuration that Yii turns into an unintended class. A GET to an admin page first stores PHP code in the session file's return URL. A second transform request then makes Yii load that session file and run the code. The attacker dropped an open-source PHP file manager, filemanager.php, later renamed autoload_classmap.php, plus other PHP files. Orange counted about 13,000 vulnerable Craft instances, and about 300 that appeared compromised.
Craft tracks its side as CVE-2025-32432, scored 10.0 by NVD. Its advisory says it got the report on April 7, 2025, shipped 3.9.15, 4.14.15 and 5.6.17 on April 10, and saw exploitation by April 17. CISA added the Yii CVE to KEV on May 2, 2025, noting that it may affect other products built on Yii. It added CVE-2025-32432 itself on March 20, 2026.
Who is affected#
Craft CMS 3, 4 and 5 below the fixed releases, and any Yii 2 application before 2.0.52 that lets request data reach object configuration. Craft Cloud's firewall blocks the exploit. Craft sites also face two other exploited bugs, CVE-2024-56145 and CVE-2025-35939.
Do you really need to act?#
Check. The fix is 18 months old, but the attack needs no login, and Craft sites are often left on old versions. Upgrading does not clean a site that was already hit. As Orange puts it, "Upgrading to a new Craft CMS version does not remove any malicious files." For custom Yii apps, risk depends on whether user input reaches Yii::createObject or component configuration. Upgrading Yii removes the question.
What to do now#
- Run
composer show yiisoft/yii2andcomposer show craftcms/cmsin each project. - Upgrade Craft, its plugins and Yii to current releases.
- Until then, block POST bodies to
actions/assets/generate-transformthat contain__class. - If a site was exposed, take it offline, remove backdoors or redeploy from clean source, update, then rotate the key with
php craft setup/security-key, plus environment secrets and database credentials.
How to tell if you were hit#
Search access logs for bursts of POSTs to generate-transform, and for admin-page GETs that redirect and carry PHP code in the query string. Search Craft logs for "Image transform cannot be created." Look for filemanager.php, autoload_classmap.php, wp-22.php and style.php, and inspect PHP session files. Orange lists attacker IPs, including 103.106.66[.]123.
Timeline#
- — The investigated Craft site is first attacked.
- — Yii 2.0.52 ships the fix as a bug fix.
- — Yii publishes its security notice; the CVE follows on April 10.
- — Craft releases 3.9.15, 4.14.15 and 5.6.17.
- — CISA adds CVE-2024-58136 to KEV.
- — CISA adds Craft's CVE-2025-32432 to KEV.
Vulnerability records
- CVE-2024-58136 · KEV 2025-05-02 · Yii 2 before 2.0.52 mishandles the attaching of behavior that is defined by an __class array key, a CVE-2024-4990 regression, as exploited in the wild in…
Sources
Original sources first: vendor and project advisories, CVE and government records, the discoverers’ write-ups. Every claim above links to one of these. See how the Security Desk works.
Original and primary sources
- Yii — Please upgrade to Yii 2.0.52 yiiframework.com
- Yii — Framework changelog (2.0.52, Bug #20232) raw.githubusercontent.com
- Craft CMS — Craft CMS and CVE-2025-32432 craftcms.com
- Orange Cyberdefense (SensePost) — Investigating an in-the-wild campaign using RCE in CraftCMS sensepost.com
- CVE record — CVE-2024-58136 cve.org
- NVD — CVE-2024-58136 nvd.nist.gov
- CISA — Known Exploited Vulnerabilities: CVE-2024-58136 cisa.gov
- NVD — CVE-2025-32432 nvd.nist.gov