CVE-2024-58136: Yiisoft/yii2 Yiisoft/yii2 Mishandles The Attaching Of Vulnerability
CRITICALCVE-2024-58136 is a CRITICAL (CVSS 9.0) yiisoft/yii2 mishandles the attaching of vulnerability (CWE-424: Improper Protection of Alternate Path) affecting Yiisoft/yii2 libraries in the Packagist ecosystem. The issue involves yiisoft/yii2 mishandles the attaching of behavior defined by a `__class` array key. Remediation is available by upgrading affected packages to version 2.0.52.
CVE-2024-58136 at a Glance
Security Impact
CVSS: 9.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:H).
How to Fix CVE-2024-58136
To remediate this vulnerability, upgrade all affected Yiisoft/yii2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade yiisoft/yii2 to 2.0.52
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for yiisoft/yii2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-58136, inspect your project dependencies for Yiisoft/yii2:
inspect dependencies for yiisoft/yii2
Analyze the terminal output to locate any version of Yiisoft/yii2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.52), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-424: Improper Protection of Alternate Path, where the product does not sufficiently protect all possible paths that a user can take to access restricted functionality or resources. In Yiisoft/yii2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-58136 Affected Yiisoft/yii2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
yiisoft/yii2
|
Packagist |
< 2.0.52
|
2.0.52
|
References
Frequently Asked Questions
What is CVE-2024-58136?
Which Yiisoft/yii2 versions are affected?
What version fixes CVE-2024-58136?
Is yiisoft/yii2 affected?
What is the CVSS score of CVE-2024-58136?
What CWE is associated with CVE-2024-58136?
How can I check Packagist dependencies for CVE-2024-58136?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ggwg-cmwp-46r5",
"modified" : "2025-10-22T19:29:49Z",
"published" : "2025-04-10T03:31:32Z",
"aliases" : [ "CVE-2024-58136" ],
"summary" : "yiisoft/yii2 Mishandles the Attaching of Behavior Defined by a `__class` Array Key",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "yiisoft/yii2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.52"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-58136"
}, {
"type" : "WEB",
"url" : "https://github.com/yiisoft/yii2/pull/20232"
}, {
"type" : "WEB",
"url" : "https://github.com/yiisoft/yii2/pull/20232#issuecomment-2252459709"
}, {
"type" : "WEB",
"url" : "https://github.com/yiisoft/yii2/commit/40fe496eda529fd1d933b56a1022ec32d3cd0b12"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/yiisoft/yii2"
}, {
"type" : "WEB",
"url" : "https://github.com/yiisoft/yii2/compare/2.0.51...2.0.52"
}, {
"type" : "WEB",
"url" : "https://sensepost.com/blog/2025/investigating-an-in-the-wild-campaign-using-rce-in-craftcms"
}, {
"type" : "WEB",
"url" : "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-58136"
}, {
"type" : "WEB",
"url" : "https://www.yiiframework.com/news/709/please-upgrade-to-yii-2-0-52"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-424" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2025-04-10T20:26:18Z",
"nvd_published_at" : "2025-04-10T03:15:17Z"
}
}