CVE-2024-58136: Yiisoft/yii2 Yiisoft/yii2 Mishandles The Attaching Of Vulnerability

CRITICAL
Advisory Identifier: GHSA-ggwg-cmwp-46r5
CVSS 9.0
CWE-424
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2024-58136
GHSA Identifier GHSA-ggwg-cmwp-46r5
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-424: Improper Protection of Alternate Path
Affected Product Yiisoft/yii2
Package Ecosystem Packagist
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A: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.

yiisoft/yii2 fixed: 2.0.52
Upgrade yiisoft/yii2 to 2.0.52
Verify Direct and Transitive Dependencies

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

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.

CVE-2024-58136 Affected Yiisoft/yii2 Versions

1 component(s)
Fixed Versions:
2.0.52
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?
CVE-2024-58136 is a security vulnerability in Yiisoft/yii2 involving yiisoft/yii2 Mishandles the Attaching of Behavior Defined by a `__class` Array Key under CWE-424: Improper Protection of Alternate Path.
Which Yiisoft/yii2 versions are affected?
Affected versions include releases prior to 2.0.52 across affected packages: yiisoft/yii2.
What version fixes CVE-2024-58136?
Upgrading to 2.0.52 (or the latest patched release for your respective branch) resolves the vulnerability.
Is yiisoft/yii2 affected?
Yes, yiisoft/yii2 is affected in releases prior to 2.0.52. Upgrade your dependency to 2.0.52 or later.
What is the CVSS score of CVE-2024-58136?
CVE-2024-58136 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:H.
What CWE is associated with CVE-2024-58136?
CVE-2024-58136 is classified under CWE-424: Improper Protection of Alternate Path (The product does not sufficiently protect all possible paths that a user can take to access restricted functionality or resources.).
How can I check Packagist dependencies for CVE-2024-58136?
Run the dependency tree command: 'inspect dependencies for yiisoft/yii2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}