CVE-2024-4990CWE-470

Unsafe Reflection in base Component class in yiisoft/yii2

High · published March 20, 2025

Patch now

High probability of exploitation

CVSS calls it high at 8.1. It sits in the 99.6th percentile for exploit probability.

CVSS v3.0
8.1
EPSS
80%
Percentile
99.6
In the wild
Unconfirmed
What it is

⚡ An unvalidated magic method in Yii2 could open the door to a world of chaos! An attacker can exploit this to instantiate arbitrary classes, passing in malicious parameters. 🔥 Think of it like a restaurant where the chef blindly accepts any recipe that customers shout from the dining area — without checking the recipe’s legitimacy, chaos could ensue in the kitchen! This vulnerability could lead to an attacker executing arbitrary code, accessing sensitive information, or even gaining unauthorized access to your system. It’s a recipe for disaster, with serious consequences that could compromise your entire application!

Put simply

Think of it like a restaurant where the chef blindly accepts any recipe that customers shout from the dining area — without checking the recipe’s legitimacy, chaos could ensue in the kitchen! In yii2 version 2.0.48, the base Component class uses the `__set()` magic method without validating the provided value against valid Behavior class names, allowing for the instantiation of arbitrary classes with potentially dangerous parameters.

What to do

This vulnerability could lead to an attacker executing arbitrary code, accessing sensitive information, or even gaining unauthorized access to your system. It’s a recipe for disaster, with serious consequences that could compromise your entire application! To remediate this vulnerability, upgrade to yii2 version 2.0.49 or later. Additionally, review your application’s usage of the `__set()` method to ensure proper validation of class names and configurations. Implement security best practices to limit potential attacks. You've got this! Following these steps will help secure your application in no time! 🛡️

The record
Technical detail
CVSS v3.0
8.1 · HIGH
Vector
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.80232 · 99.6th percentile
Weakness
CWE-470 · Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Published
2025-03-20T10:11Z
EPSS history
Timeline
  • 20 MAR 10:11Z
    Unsafe Reflection in base Component class in yiisoft/yii2
    cvelistv5