CVE-2024-58136

9.0 CRITICAL CISA KEV

📋 TL;DR

This CVE describes a security regression in Yii 2 framework where improper handling of behavior attachment via __class array keys can lead to remote code execution. This affects Yii 2 applications running versions before 2.0.52. The vulnerability has been actively exploited in the wild.

💻 Affected Systems

Products:
  • Yii 2 PHP Framework
Versions: All versions before 2.0.52
Operating Systems: All operating systems running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Any Yii 2 application using behavior attachment functionality is vulnerable. The vulnerability is a regression of CVE-2024-4990.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution allowing full system compromise, data exfiltration, and lateral movement within the network.

🟠

Likely Case

Remote code execution leading to web application compromise, data theft, and potential server takeover.

🟢

If Mitigated

Limited impact if proper input validation and behavior filtering are implemented at application layer.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Actively exploited in the wild from February through April 2025. Exploitation requires the ability to control behavior attachment parameters.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.0.52

Vendor Advisory: https://www.yiiframework.com/news/709/please-upgrade-to-yii-2-0-52

Restart Required: No

Instructions:

1. Update Yii 2 framework to version 2.0.52 or later. 2. Update composer.json to require "yiisoft/yii2": "^2.0.52". 3. Run composer update. 4. Test application functionality.

🔧 Temporary Workarounds

Input validation for behavior parameters

all

Implement strict validation and filtering of all user-controlled parameters used in behavior attachment

🧯 If You Can't Patch

  • Implement WAF rules to block suspicious behavior attachment requests
  • Restrict access to vulnerable endpoints using authentication and authorization controls

🔍 How to Verify

Check if Vulnerable:

Check composer.json or vendor/yiisoft/yii2/BaseYii.php version. If version is below 2.0.52, the system is vulnerable.

Check Version:

php -r "echo Yii::getVersion();"

Verify Fix Applied:

Verify that vendor/yiisoft/yii2/BaseYii.php contains the fix from commit 40fe496eda529fd1d933b56a1022ec32d3cd0b12

📡 Detection & Monitoring

Log Indicators:

  • Unusual behavior attachment requests
  • Suspicious __class parameter values in logs
  • Unexpected PHP execution errors

Network Indicators:

  • HTTP requests with unusual behavior parameters
  • POST requests containing __class keys

SIEM Query:

web_requests WHERE (url_path CONTAINS 'behavior' OR parameters CONTAINS '__class') AND suspicious_patterns

🔗 References

📤 Share & Export