CVE-2024-58136 is a critical-severity (CVSS 9) CWE-424 vulnerability in yiisoft/yii2. It is in CISA's Known Exploited Vulnerabilities catalog (added 2025-05-02) — treat it as actively exploited and patch now. A fix is available for yiisoft/yii2 — see the affected versions and patch details below.
yiisoft/yii2 Mishandles the Attaching of Behavior Defined by a `__class` Array Key
Exploitation Status
Actively exploited in the wild
- Confirmed by CISA's Known Exploited Vulnerabilities catalog on 2025-05-02. Federal agencies were required to remediate by 2025-05-23.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA (KEV catalog and SSVC triage) for CVE-2024-58136.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2024-58136 by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).
Where this sits among everything scored
Of 395,249 CVEs with a current EPSS score, this one falls in the 50–90% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
yiisoft/yii2Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
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 February through April 2025.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | yiisoft/yii2 | all versions | 2.0.52composer require yiisoft/yii2:^2.0.52 |
Affected Products
yiiyiiframeworkDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for yiisoft/yii2, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update yiisoft/yii2 to 2.0.52 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-58136 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How to detect CVE-2024-58136
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2024-58136 -u https://target- Template
- Yii2 PHP Framework < 2.0.52 - Remote Code Execution
- Severity
- critical
- Impact
- Unauthenticated attackers can exploit improper validation of the __class key in JSON behaviors to instantiate arbitrary PHP classes and achieve remote code execution.
- Remediation
- Update Yii2 PHP Framework to version 2.0.52 or later to address the remote code execution vulnerability.
Template by ProjectDiscovery nuclei-templates (ritikchaddha), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is CVE-2024-58136 in your dependencies?
Find it across Packagist, including transitive dependencies.