Analysis Report Yii 2.0.51 → 2.0.52 - CVE-2024-58136

Shared security patch analysis results

AI Used: deepseek deepseek-chat
Share this analysis
Use quotes for exact: \"SQL injection\" | Operators: hello AND bye, admin OR root, -error, NOT warning
Showing 0 to 0 of 0 results
.well-known/funding-manifest-urls AI: Not Sure
--- /dev/null+++ cache/yii2_2.0.52/.well-known/funding-manifest-urls@@ -0,0 +1,1 @@+https://www.yiiframework.com/funding.json
AI Analysis
Vulnerability Existed: not sure  
CWE-829: Inclusion of Functionality from Untrusted Control Sphere - .well-known/funding-manifest-urls [Line 1]  
Old Code:  
```  
(none)  
```  
Fixed Code:  
```  
https://www.yiiframework.com/funding.json  
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
composer.json AI: 1 vulnerabilities
--- cache/yii2_2.0.51/composer.json	2025-10-29 14:10:01.348475561 +0000+++ cache/yii2_2.0.52/composer.json	2025-10-29 14:10:03.923638945 +0000@@ -78,8 +78,7 @@         "bower-asset/jquery": "3.7.*@stable | 3.6.*@stable | 3.5.*@stable | 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable",         "bower-asset/inputmask": "^5.0.8 ",         "bower-asset/punycode": "^2.2",-        "bower-asset/yii2-pjax": "~2.0.1",-        "paragonie/random_compat": ">=1"+        "bower-asset/yii2-pjax": "~2.0.1"     },     "require-dev": {         "cebe/indent": "~1.0.2",
AI Analysis
Vulnerability Existed: yes  
CWE-331 - Insufficient Entropy - composer.json Lines 78-81  
Old Code:  
```json  
"bower-asset/yii2-pjax": "~2.0.1",  
"paragonie/random_compat": ">=1"  
```  
Fixed Code:  
```json  
"bower-asset/yii2-pjax": "~2.0.1"  
```  

**Note:** The removal of `paragonie/random_compat` dependency suggests the project may have been relying on this library for secure random number generation. Without this dependency, there could be insufficient entropy if proper alternatives aren't implemented, potentially leading to predictable random values in security-sensitive contexts.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
composer.lock AI: 1 vulnerabilities
--- cache/yii2_2.0.51/composer.lock	2025-10-29 14:10:01.348475561 +0000+++ cache/yii2_2.0.52/composer.lock	2025-10-29 14:10:03.924639008 +0000@@ -4,7 +4,7 @@         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",         "This file is @generated automatically"     ],-    "content-hash": "67d678d7fc90991fe6c1967c41f6264d",+    "content-hash": "3faf6ba20beedc1db7758907d00f6681",     "packages": [         {             "name": "bower-asset/inputmask",@@ -207,56 +207,6 @@             "time": "2023-11-17T15:01:25+00:00"         },         {-            "name": "paragonie/random_compat",-            "version": "v9.99.100",-            "source": {-                "type": "git",-                "url": "https://github.com/paragonie/random_compat.git",-                "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"-            },-            "dist": {-                "type": "zip",-                "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",-                "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",-                "shasum": ""-            },-            "require": {-                "php": ">= 7"-            },-            "require-dev": {-                "phpunit/phpunit": "4.*|5.*",-                "vimeo/psalm": "^1"-            },-            "suggest": {-                "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."-            },-            "type": "library",-            "notification-url": "https://packagist.org/downloads/",-            "license": [-                "MIT"-            ],-            "authors": [-                {-                    "name": "Paragon Initiative Enterprises",-                    "email": "[email protected]",-                    "homepage": "https://paragonie.com"-                }-            ],-            "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",-            "keywords": [-                "csprng",-                "polyfill",-                "pseudorandom",-                "random"-            ],-            "support": {-                "email": "[email protected]",-                "issues": "https://github.com/paragonie/random_compat/issues",-                "source": "https://github.com/paragonie/random_compat"-            },-            "time": "2020-10-15T08:29:30+00:00"-        },-        {             "name": "yiisoft/yii2-composer",             "version": "2.0.10",             "source": {
AI Analysis
Vulnerability Existed: yes  
CWE-331: Insufficient Entropy - CWE-331 - composer.lock [Lines 207-256]  
[Old Code]  
```json
{
    "name": "paragonie/random_compat",
    "version": "v9.99.100",
    "source": {
        "type": "git",
        "url": "https://github.com/paragonie/random_compat.git",
        "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
    },
    ...
    "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
    ...
}
```  
[Fixed Code]  
*Removed dependency on paragonie/random_compat*
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-ja/db-active-record.md AI: No vulnerabilities
--- cache/yii2_2.0.51/docs/guide-ja/db-active-record.md	2025-10-29 14:10:01.382477718 +0000+++ cache/yii2_2.0.52/docs/guide-ja/db-active-record.md	2025-10-29 14:10:03.958641166 +0000@@ -650,6 +650,16 @@ > - [[yii\db\ActiveRecord::updateCounters()]]  > - [[yii\db\ActiveRecord::updateAllCounters()]]  +> Note: パフォーマンスを考慮して、DI(依存注入) はデフォルトではサポートされていません。必要であれば、+> [[Yii::createObject()]] によってクラスのインスタンス生成をするように [[yii\db\ActiveRecord::instantiate()|instantiate()]] メソッドをオーバーライドして、サポートを追加することが出来ます。+> +> ```php+> public static function instantiate($row)+> {+>     return Yii::createObject(static::class);+> }+> ```+ ### データをリフレッシュする際のライフサイクル <span id="refreshing-data-life-cycle"></span>  [[yii\db\ActiveRecord::refresh()|refresh()]] を呼んでアクティブ・レコード・インスタンスをリフレッシュする際は、リフレッシュが成功してメソッドが `true` を返すと
AI Analysis
Based on the provided code diff, I will analyze it for security fixes.

Analysis:
1. The diff shows an addition of a note about Dependency Injection (DI) support in ActiveRecord.
2. It adds documentation about overriding the `instantiate()` method to support DI using `Yii::createObject()`.
3. This appears to be documentation-only change in a Japanese language guide file.
4. No actual code changes to the framework itself are present in this diff.

Answer:

    Vulnerability Existed: no
    No vulnerability identified - N/A - docs/guide-ja/db-active-record.md Lines 650-660
    [No old code was present at these lines]
    [Added documentation note about DI support and instantiate() method override]

Explanation:
- This is a documentation update in a markdown file, not a code change
- The content appears to be adding explanatory text about how to enable DI support in ActiveRecord
- No security vulnerability is being fixed in this diff
- The change is purely informational/educational in nature
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-ru/concept-behaviors.md AI: No vulnerabilities
--- cache/yii2_2.0.51/docs/guide-ru/concept-behaviors.md	2025-10-29 14:10:01.401478924 +0000+++ cache/yii2_2.0.52/docs/guide-ru/concept-behaviors.md	2025-10-29 14:10:03.977642371 +0000@@ -327,8 +327,8 @@ сторонние:  - [[yii\behaviors\BlameableBehavior]] - автоматически заполняет указанные атрибуты ID текущего пользователя.-- [[yii\behaviors\SluggableBehavior]] - автоматически заполняет указанные атрибут пригодным для URL текстом, получаемым-  из другого атрибута.+- [[yii\behaviors\SluggableBehavior]] - автоматически заполняет указанный атрибут пригодным для URL текстом, получаемым+  из 1 или нескольких других атрибутов. - [[yii\behaviors\AttributeBehavior]] - автоматически задаёт указанное значение одному или нескольким атрибутам   ActiveRecord при срабатывании определённых событий. - [yii2tech\ar\softdelete\SoftDeleteBehavior](https://github.com/yii2tech/ar-softdelete) - предоставляет методы для
AI Analysis
Vulnerability Existed: no
No vulnerability - N/A - docs/guide-ru/concept-behaviors.md [327-328]
[Old Code]
- [[yii\behaviors\SluggableBehavior]] - автоматически заполняет указанные атрибут пригодным для URL текстом, получаемым
  из другого атрибута.
[Fixed Code]
+ [[yii\behaviors\SluggableBehavior]] - автоматически заполняет указанный атрибут пригодным для URL текстом, получаемым
+  из 1 или нескольких других атрибутов.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-ru/db-active-record.md AI: No vulnerabilities
--- cache/yii2_2.0.51/docs/guide-ru/db-active-record.md	2025-10-29 14:10:01.401478924 +0000+++ cache/yii2_2.0.52/docs/guide-ru/db-active-record.md	2025-10-29 14:10:03.977642371 +0000@@ -537,7 +537,7 @@ Можно также использовать условия для столбцов JSON:  ```php-$query->andWhere(['=', 'json', new ArrayExpression(['foo' => 'bar'])+$query->andWhere(['=', 'json', new ArrayExpression(['foo' => 'bar'])]) ``` Дополнительные сведения о системе построения выражений см. [Query Builder – добавление пользовательских условий и выражений](db-query-builder.md#adding-custom-conditions-and-expressions) 
AI Analysis
Vulnerability Existed: no
No vulnerability - N/A - docs/guide-ru/db-active-record.md [537]
[Old Code]
$query->andWhere(['=', 'json', new ArrayExpression(['foo' => 'bar'])
[Fixed Code]
$query->andWhere(['=', 'json', new ArrayExpression(['foo' => 'bar'])])

Analysis: This diff shows a simple syntax fix in documentation. The original code was missing a closing parenthesis. This is not a security vulnerability but rather a documentation correction to fix a syntax error in a code example. The change doesn't affect any actual application code, only documentation.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-ru/helper-array.md AI: No vulnerabilities
--- cache/yii2_2.0.51/docs/guide-ru/helper-array.md	2025-10-29 14:10:01.402478987 +0000+++ cache/yii2_2.0.52/docs/guide-ru/helper-array.md	2025-10-29 14:10:03.978642435 +0000@@ -5,7 +5,7 @@  ## Получение значений <span id="getting-values"></span> -Извлечение значений из массива, объекта или структуры состоящей из них обоих с помощью стандартных средств PHP является довольно скучным занятием. Сначала вам нужно проверить есть ли соответствующий ключ с помощью `isset`, и если есть – получить, если нет – подставить значение по умолчанию.+Извлечение значений из массива, объекта или структуры состоящей из них обоих с помощью стандартных средств PHP является довольно скучным занятием. Сначала вам нужно проверить, есть ли соответствующий ключ с помощью `isset`, и если есть – получить, если нет – подставить значение по умолчанию.  ```php class User@@ -152,9 +152,10 @@ ## Переиндексация массивов <span id="reindexing-arrays"></span>  -Чтобы проиндексировать массив в соответствии с определенным ключом, используется метод `index` . Входящий массив должен+Чтобы проиндексировать массив в соответствии с определенным ключом, используется метод `index`. Входящий массив должен быть многомерным или массивом объектов. Ключом может быть имя ключа вложенного массива, имя свойства объекта или-анонимная функция, которая будет возвращать значение ключа по переданному массиву.+анонимная функция, которая будет возвращать значение ключа по переданному элементу индексируемого массива (то есть по+вложенному массиву или объекту).  Если значение ключа равно `null`, то соответствующий элемент массива будет опущен и не попадет в результат. @@ -347,3 +348,140 @@ ArrayHelper::isSubset(new(ArrayObject['a', 'c']), new(ArrayObject['a', 'b', 'c'])  ```++## Преобразование многомерных массивов <span id="flattening-arrays"></span>++Метод `ArrayHelper::flatten()` позволяет преобразовать многомерный массив в одномерный, объединяя ключи.++### Основное использование++Чтобы преобразовать вложенный массив, просто передайте массив в метод `flatten()`:++```php+$array = [+    'a' => [+        'b' => [+            'c' => 1,+            'd' => 2,+        ],+        'e' => 3,+    ],+    'f' => 4,+];++$flattenedArray = ArrayHelper::flatten($array);+// Результат:+// [+//     'a.b.c' => 1,+//     'a.b.d' => 2,+//     'a.e' => 3,+//     'f' => 4,+// ]+```++### Пользовательский разделитель++Вы можете указать пользовательский (т.е. отличный от значения по умолчанию: `.`) разделитель для объединения ключей:++```php+$array = [+    'a' => [+        'b' => [+            'c' => 1,+            'd' => 2,+        ],+        'e' => 3,+    ],+    'f' => 4,+];++$flattenedArray = ArrayHelper::flatten($array, '_');+// Результат:+// [+//     'a_b_c' => 1,+//     'a_b_d' => 2,+//     'a_e' => 3,+//     'f' => 4,+// ]+```++### Обработка специальных символов в ключах++Метод `flatten()` может обрабатывать ключи со специальными символами:++```php+$array = [+    'a.b' => [+        'c.d' => 1,+    ],+    'e.f' => 2,+];++$flattenedArray = ArrayHelper::flatten($array);+// Результат:+// [+//     'a.b.c.d' => 1,+//     'e.f' => 2,+// ]+```++### Смешанные типы данных++Метод `flatten()` работает с массивами, содержащими различные типы данных:++```php+$array = [+    'a' => [+        'b' => 'string',+        'c' => 123,+        'd' => true,+        'e' => null,+    ],+    'f' => [1, 2, 3],+];++$flattenedArray = ArrayHelper::flatten($array);+// Результат:+// [+//     'a.b' => 'string',+//     'a.c' => 123,+//     'a.d' => true,+//     'a.e' => null,+//     'f.0' => 1,+//     'f.1' => 2,+//     'f.2' => 3,+// ]+```++### Краевые случаи++Метод `flatten()` обрабатывает различные краевые случаи, такие как пустые массивы и значения, не являющиеся массивами:++```php+// Пустой массив+$array = [];+$flattenedArray = ArrayHelper::flatten($array);+// Результат: []++// Значение, не являющееся массивом+$array = 'string';+$flattenedArray = ArrayHelper::flatten($array);+// Результат:+// yii\base\InvalidArgumentException: Argument $array must be an array or implement Traversable+```++### Коллизии ключей++Когда ключи совпадают, метод `flatten()` перезапишет предыдущее значение:++```php+$array = [+    'a' => [+        'b' => 1,+    ],+    'a.b' => 2,+];++$flattenedArray = ArrayHelper::flatten($array);+// Результат: ['a.b' => 2]+```
AI Analysis
Vulnerability Existed: no
No security vulnerabilities found - This is a documentation update only

The provided diff shows changes to a Russian language documentation file (helper-array.md). The changes include:
- Minor text corrections and clarifications
- Addition of documentation for a new `ArrayHelper::flatten()` method
- Code examples showing the method's usage

Since this is purely documentation content and doesn't modify any actual PHP code, there are no security vulnerabilities to analyze. The changes are related to improving documentation clarity and adding documentation for a new feature.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-ru/helper-overview.md AI: No vulnerabilities
--- cache/yii2_2.0.51/docs/guide-ru/helper-overview.md	2025-10-29 14:10:01.402478987 +0000+++ cache/yii2_2.0.52/docs/guide-ru/helper-overview.md	2025-10-29 14:10:03.978642435 +0000@@ -3,8 +3,8 @@  > Note: Этот раздел находиться в стадии разработки. -Yii предоставляет много классов, которые помогают упростить общие задачи программирования, такие как манипуляция со строками или массивами, генерация HTML-кода, и так далее. Все helper-классы организованы в рамках пространства имен `yii\helpers` и являются статическими методами- (это означает, что они содержат в себе только статические свойства и методы и объекты статического класса создать нельзя).+Yii предоставляет много классов, которые помогают упростить общие задачи программирования, такие как манипуляция со строками или массивами, генерация HTML-кода, и так далее. Все helper-классы организованы в рамках пространства имен `yii\helpers` и являются статическими классами+ (это означает, что они содержат в себе только статические свойства и методы, и объекты статического класса создать нельзя).  Вы можете использовать helper-класс с помощью вызова одного из статических методов, как показано ниже: 
AI Analysis
Based on the provided code diff, I'm analyzing a documentation file change in a Russian language guide. The changes appear to be purely linguistic/grammatical corrections rather than security fixes.

Vulnerability Existed: no
No security vulnerability - N/A - docs/guide-ru/helper-overview.md Lines 3-8
Old Code:
Yii предоставляет много классов, которые помогают упростить общие задачи программирования, такие как манипуляция со строками или массивами, генерация HTML-кода, и так далее. Все helper-классы организованы в рамках пространства имен `yii\helpers` и являются статическими методами
 (это означает, что они содержат в себе только статические свойства и методы и объекты статического класса создать нельзя).
Fixed Code:
Yii предоставляет много классов, которые помогают упростить общие задачи программирования, такие как манипуляция со строками или массивами, генерация HTML-кода, и так далее. Все helper-классы организованы в рамках пространства имен `yii\helpers` и являются статическими классами
 (это означает, что они содержат в себе только статические свойства и методы, и объекты статического класса создать нельзя).

The changes are:
1. "статическими методами" changed to "статическими классами" (static methods → static classes)
2. Added a comma in the parenthetical explanation for better grammar
These are documentation improvements with no security implications.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-ru/input-file-upload.md AI: No vulnerabilities
--- cache/yii2_2.0.51/docs/guide-ru/input-file-upload.md	2025-10-29 14:10:01.403479051 +0000+++ cache/yii2_2.0.52/docs/guide-ru/input-file-upload.md	2025-10-29 14:10:03.980642562 +0000@@ -74,7 +74,7 @@ <?php ActiveForm::end() ?> ``` -Важно помнить, что для корректной загрузки файла, необходим параметр формы `enctype`. Метод `fileInput()`+Важно помнить, что для корректной загрузки файла необходим параметр формы `enctype`. Метод `fileInput()` выведет тег `<input type="file">`, позволяющий пользователю выбрать файл для загрузки.  > Tip: начиная с версии 2.0.8, [[yii\widgets\ActiveField::fileInput|fileInput]] автоматически добавляет
AI Analysis
Based on the provided code diff, I will analyze it for security fixes according to the specified format.

```
Vulnerability Existed: no
No vulnerability identified - N/A - docs/guide-ru/input-file-upload.md Lines 74
-Важно помнить, что для корректной загрузки файла, необходим параметр формы `enctype`. Метод `fileInput()`
+Важно помнить, что для корректной загрузки файла необходим параметр формы `enctype`. Метод `fileInput()`
```

**Explanation:**
The diff shows only a minor grammatical correction in Russian documentation. It removes a comma from the sentence "для корректной загрузки файла, необходим параметр" to "для корректной загрузки файла необходим параметр". This change does not affect any code functionality, security controls, or vulnerability mitigation. It's purely a documentation improvement for better readability in the Russian language guide.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-ru/runtime-logging.md AI: 1 vulnerabilities
--- cache/yii2_2.0.51/docs/guide-ru/runtime-logging.md	2025-10-29 14:10:01.404479114 +0000+++ cache/yii2_2.0.52/docs/guide-ru/runtime-logging.md	2025-10-29 14:10:03.981642625 +0000@@ -173,6 +173,23 @@ При задании значением свойства `logVars` пустого массива, общая информация не будет выводиться. Для определения собственного алгоритма подключения общей информации, следует переопределить метод [[yii\log\Target::getContextMessage()]]. +Если некоторые из полей вашего запроса содержат конфиденциальную информацию, которую вы не хотели бы логировать (например, пароли, токены доступа),+вы можете дополнительно настроить свойство `maskVars`, которое может содержать как точные значения, так и шаблоны (без учета регистра).+По умолчанию следующие параметры запроса будут замаскированы с помощью `***`:+`$_SERVER[HTTP_AUTHORIZATION]`, `$_SERVER[PHP_AUTH_USER]`, `$_SERVER[PHP_AUTH_PW]`, но вы можете задать свои собственные. Например:++```php+[+    'class' => 'yii\log\FileTarget',+    'logVars' => ['_SERVER'],+    'maskVars' => [+        '_SERVER.HTTP_X_PASSWORD',+        '_SERVER.*_SECRET', // соответствует всем, заканчивающимся на "_SECRET"+        '_SERVER.SECRET_*', // соответствует всем, начинающимся с "SECRET_"+        '_SERVER.*SECRET*', // соответствует всем содержащим "SECRET"+    ]+]+```  ### Уровень отслеживания выполнения кода <span id="trace-level"></span> 
AI Analysis
Vulnerability Existed: yes  
CWE-532: Insertion of Sensitive Information into Log File - docs/guide-ru/runtime-logging.md [Lines 173+]  
Old Code:  
```markdown
При задании значением свойства `logVars` пустого массива, общая информация не будет выводиться.
Для определения собственного алгоритма подключения общей информации, следует переопределить метод [[yii\log\Target::getContextMessage()]].
```

Fixed Code:  
```markdown
При задании значением свойства `logVars` пустого массива, общая информация не будет выводиться.
Для определения собственного алгоритма подключения общей информации, следует переопределить метод [[yii\log\Target::getContextMessage()]].

Если некоторые из полей вашего запроса содержат конфиденциальную информацию, которую вы не хотели бы логировать (например, пароли, токены доступа),
вы можете дополнительно настроить свойство `maskVars`, которое может содержать как точные значения, так и шаблоны (без учета регистра).
По умолчанию следующие параметры запроса будут замаскированы с помощью `***`:
`$_SERVER[HTTP_AUTHORIZATION]`, `$_SERVER[PHP_AUTH_USER]`, `$_SERVER[PHP_AUTH_PW]`, но вы можете задать свои собственные. Например:

```php
[
    'class' => 'yii\log\FileTarget',
    'logVars' => ['_SERVER'],
    'maskVars' => [
        '_SERVER.HTTP_X_PASSWORD',
        '_SERVER.*_SECRET', // соответствует всем, заканчивающимся на "_SECRET"
        '_SERVER.SECRET_*', // соответствует всем, начинающимся с "SECRET_"
        '_SERVER.*SECRET*', // соответствует всем содержащим "SECRET"
    ]
]
```
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-ru/tutorial-i18n.md AI: No vulnerabilities
--- cache/yii2_2.0.51/docs/guide-ru/tutorial-i18n.md	2025-10-29 14:10:01.406479241 +0000+++ cache/yii2_2.0.52/docs/guide-ru/tutorial-i18n.md	2025-10-29 14:10:03.984642815 +0000@@ -506,9 +506,9 @@ Откройте созданный файл и настройте параметры в соответствии со своими потребностями. Уделите особое внимание следующим параметрам:  * `languages`: массив, содержащий языки, на которые ваше приложение должно быть переведено;-* `messagePath`: путь для хранений файлов сообщений, который должен соответствовать параметру `basePath`, указанному в конфигурации компонента`i18n`.+* `messagePath`: путь для хранения файлов сообщений, который должен соответствовать параметру `basePath`, указанному в конфигурации компонента `i18n`. -Вы также можете использовать команду './yii message/config', чтобы динамически сгенерировать конфигурационный файл с указанными опциями с помощью командной строки.+Вы также можете использовать команду `./yii message/config`, чтобы динамически сгенерировать конфигурационный файл с указанными опциями с помощью командной строки. Например, вы можете установить параметры `languages` и `messagePath` следующим образом:  ```bash@@ -529,7 +529,7 @@  Также вы можете использовать параметры, чтобы динамически менять настройки извлечения. -В результате вы найдете свой файлы (если вы выбрали перевод с помощью файлов) в своей директории `messagePath`.+В результате вы найдете свои файлы (если вы выбрали перевод с помощью файлов) в своей директории `messagePath`.   Представления <span id="view-translation"></span>
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - docs/guide-ru/tutorial-i18n.md [Lines 506-529]
[Old Code]
* `messagePath`: путь для хранений файлов сообщений, который должен соответствовать параметру `basePath`, указанному в конфигурации компонента`i18n`.

Вы также можете использовать команду './yii message/config', чтобы динамически сгенерировать конфигурационный файл с указанными опциями с помощью командной строки.

В результате вы найдете свой файлы (если вы выбрали перевод с помощью файлов) в своей директории `messagePath`.
[Fixed Code]
* `messagePath`: путь для хранения файлов сообщений, который должен соответствовать параметру `basePath`, указанному в конфигурации компонента `i18n`.

Вы также можете использовать команду `./yii message/config`, чтобы динамически сгенерировать конфигурационный файл с указанными опциями с помощью командной строки.

В результате вы найдете свои файлы (если вы выбрали перевод с помощью файлов) в своей директории `messagePath`.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide-uk/runtime-sessions-cookies.md AI: 2 vulnerabilities
--- /dev/null+++ cache/yii2_2.0.52/docs/guide-uk/runtime-sessions-cookies.md@@ -0,0 +1,285 @@+Сесії та кукі+====================++Сесії та кукі дозволяють зберігати користувацькі дані між запитами. При використанні чистого PHP можна отримати доступ до цих даних через глобальні змінні `$_SESSION` та `$_COOKIE`, відповідно. Yii інкапсулює сесії та кукі в об'єкти, що дає можливість звертатися до них в об'єктноорієнтованому стилі та забезпечує додаткову зручність в роботі.+++## Сесії <span id="sessions"></span>++За аналогією з [запитами](runtime-requests.md) та [відповідями](runtime-responses.md), до сесій можна отримати доступ через `session` [компонент додатка](structure-application-components.md), який за замовчуванням є екземпляром [[yii\web\Session]].+++### Відкриття та закриття сесії <span id="opening-closing-sessions"></span>++Відкрити та закрити сесію можна наступним чином:++```php+$session = Yii::$app->session;++// перевіряєм що сесія вже відкрита+if ($session->isActive) ...++// відкиваєм сесію+$session->open();++// закриваємо сесію+$session->close();++// знищуємо сесію і всі пов'язані з нею дані.+$session->destroy();+```++Можна викликати [[yii\web\Session::open()|open()]] і [[yii\web\Session::close()|close()]] багаторазово без виникнення помилок; всередині компонента всі методи перевіряють сесію на те, відкрита вона чи ні.+++### Доступ до даних сесії <span id="access-session-data"></span>++Отримати доступ до збережених в сесію даних можна наступним чином:++```php+$session = Yii::$app->session;++// отримання змінної з сесії. Наступні способи використання еквівалентні:+$language = $session->get('language');+$language = $session['language'];+$language = isset($_SESSION['language']) ? $_SESSION['language'] : null;++// запис змінної в сесію. Наступні способи використання еквівалентні:+$session->set('language', 'en-US');+$session['language'] = 'en-US';+$_SESSION['language'] = 'en-US';++// видалення змінної з сесії. Наступні способи використання еквівалентні:+$session->remove('language');+unset($session['language']);+unset($_SESSION['language']);++// перевірка на існування змінної в сесії. Наступні способи використання еквівалентні:+if ($session->has('language')) ...+if (isset($session['language'])) ...+if (isset($_SESSION['language'])) ...++// обхід усіх змінних у сесії. Наступні способи використання еквівалентні:+foreach ($session as $name => $value) ...+foreach ($_SESSION as $name => $value) ...+```++> Info: При отриманні даних з сесії через компонент `session`, сесія буде автоматично відкрита, якщо вона не була відкрита до цього. У цьому полягає відмінність від отримання даних з глобальної змінної `$_SESSION`, що вимагає обов'язкового виклику `session_start()`.++При роботі з сесійними даними, які є масивами, компонент `session` має обмеження, що забороняє пряму модифікацію окремих елементів масиву. Наприклад,++```php+$session = Yii::$app->session;++// наступний код НЕ БУДЕ працювати+$session['captcha']['number'] = 5;+$session['captcha']['lifetime'] = 3600;++// а цей буде:+$session['captcha'] = [+    'number' => 5,+    'lifetime' => 3600,+];++// цей код також буде працювати:+echo $session['captcha']['lifetime'];+```++Для вирішення цієї проблеми можна використовувати такі обхідні прийоми:++```php+$session = Yii::$app->session;++// пряме використання $_SESSION (переконайтеся, що Yii::$app->session->open() був викликаний)+$_SESSION['captcha']['number'] = 5;+$_SESSION['captcha']['lifetime'] = 3600;++// отримайте весь масив, модифікуйте і збережіть назад у сесію+$captcha = $session['captcha'];+$captcha['number'] = 5;+$captcha['lifetime'] = 3600;+$session['captcha'] = $captcha;++// використовуйте ArrayObject замість масиву+$session['captcha'] = new \ArrayObject;+...+$session['captcha']['number'] = 5;+$session['captcha']['lifetime'] = 3600;++// записуйте дані з ключами, які мають однаковий префікс+$session['captcha.number'] = 5;+$session['captcha.lifetime'] = 3600;+```++Для покращення продуктивності та читабельності коду рекомендується використовувати останній прийом. Іншими словами, замість того, щоб зберігати масив як одну змінну сесії, ми зберігаємо кожен елемент масиву як звичайну сесійну змінну зі спільним префіксом.+++### Користувацьке сховище для сесії <span id="custom-session-storage"></span>++За замовчуванням клас [[yii\web\Session]] зберігає дані сесії у вигляді файлів на сервері. Однак Yii надає ряд класів, які реалізують різні способи зберігання даних сесії:++* [[yii\web\DbSession]]: зберігає дані сесії в базі даних.+* [[yii\web\CacheSession]]: зберігання даних сесії в попередньо сконфігурованому компоненті кешу [кеш](caching-data.md#cache-components).+* [[yii\redis\Session]]: зберігання даних сесії в [redis](https://redis.io/).+* [[yii\mongodb\Session]]: зберігання сесії в [MongoDB](https://www.mongodb.com/).++Усі ці класи підтримують однаковий набір методів API. В результаті ви можете перемикатися між різними сховищами сесій без модифікації коду додатку.++> Note: Якщо ви хочете отримати дані з змінної `$_SESSION` при використанні користувацького сховища, ви повинні бути впевнені, що сесія вже стартувала [[yii\web\Session::open()]], оскільки обробники зберігання користувацьких сесій реєструються в цьому методі.++Щоб дізнатися, як налаштувати і використовувати ці компоненти, зверніться до документації по API. Нижче наведено приклад конфігурації [[yii\web\DbSession]] для використання бази даних для зберігання сесії:++```php+return [+    'components' => [+        'session' => [+            'class' => 'yii\web\DbSession',+            // 'db' => 'mydb',  // ID компонента для взаємодії з БД. По замовчуванню 'db'.+            // 'sessionTable' => 'my_session', // назва таблиці для даних сесії. По замовчуванню 'session'.+        ],+    ],+];+```++Також необхідно створити таблицю для зберігання даних сесії:++```sql+CREATE TABLE session+(+    id CHAR(40) NOT NULL PRIMARY KEY,+    expire INTEGER,+    data BLOB+)+```++де 'BLOB' відповідає типу даних вашої DBMS. Нижче наведені приклади відповідності типів BLOB у найбільш популярних DBMS:++- MySQL: LONGBLOB+- PostgreSQL: BYTEA+- MSSQL: BLOB++> Note: В залежності від налаштувань параметра `session.hash_function` у вашому php.ini, може знадобитися змінити довжину поля `id`. Наприклад, якщо `session.hash_function=sha256`, потрібно встановити довжину поля на 64 замість 40.++### Flash-повідомлення <span id="flash-data"></span>++Flash-повідомлення - це особливий тип даних у сесії, які встановлюються один раз під час запиту і доступні лише протягом наступного запиту, після чого вони автоматично видаляються. Такий спосіб зберігання інформації в сесії найчастіше використовується для реалізації повідомлень, які будуть відображені кінцевому користувачу один раз, наприклад, підтвердження про успішну відправку форми.++Встановити та отримати flash-повідомлення можна через компонент програми `session`. Наприклад:++```php+$session = Yii::$app->session;++// Запит #1+// встановлення flash-повідомлення з назвою "postDeleted"+$session->setFlash('postDeleted', 'Ви успішно видалили пост.');++// Запит #2+// відображення flash-повідомлення "postDeleted"+echo $session->getFlash('postDeleted');++// Запит #3+// змінна $result буде мати значення false, оскільки flash-повідомлення було автоматично видалено+$result = $session->hasFlash('postDeleted');+```++Оскільки flash-повідомлення зберігаються в сесії як звичайні дані, в них можна записувати довільну інформацію, і вона буде доступна лише в наступному запиті.++При виклику [[yii\web\Session::setFlash()]] відбувається перезаписування flash-повідомлень з таким же назвою. Для того, щоб додати нові дані до вже існуючого flash-повідомлення, необхідно викликати [[yii\web\Session::addFlash()]]. +Наприклад:++```php+$session = Yii::$app->session;++// Запит #1+// додати нове flash-повідомлення з назвою "alerts"+$session->addFlash('alerts', 'Ви успішно видалили пост.');+$session->addFlash('alerts', 'Ви успішно додали нового друга.');+$session->addFlash('alerts', 'Дякуємо.');++// Запит #2+// Змінна $alerts тепер містить масив flash-повідомлень з назвою "alerts"+$alerts = $session->getFlash('alerts');+```++> Note: Намагайтеся не використовувати [[yii\web\Session::setFlash()]] спільно з [[yii\web\Session::addFlash()]] для flash-повідомлень з однаковою назвою. Це пов'язано з тим, що останній метод автоматично перетворює збережені дані в масив, щоб мати можливість зберігати та додавати нові дані в flash-повідомлення з тією ж назвою. В результаті, при виклику [[yii\web\Session::getFlash()]] можна виявити, що повертається масив, тоді як очікувалася строка.++## Кукі <span id="cookies"></span>++Yii представляє кожну з cookie як об'єкт [[yii\web\Cookie]]. Обидва компоненти програми [[yii\web\Request]] і [[yii\web\Response]] +підтримують колекції кукі через своє властивість cookies. У першому випадку колекція кукі є їх представленням з HTTP-запиту, у другому — представляє кукі, які будуть відправлені користувачу.++### Читання кукі <span id="reading-cookies"></span>++Отримати кукі з поточного запиту можна наступним чином:++```php+// отримання колекції кукі (yii\web\CookieCollection) з компонента "request"+$cookies = Yii::$app->request->cookies;++// отримання кукі з назвою "language". Якщо кукі не існує, "en" буде повернуто як значення за замовчуванням.+$language = $cookies->getValue('language', 'en');++// альтернативний спосіб отримання кукі "language"+if (($cookie = $cookies->get('language')) !== null) {+    $language = $cookie->value;+}++// тепер змінну $cookies можна використовувати як масив+if (isset($cookies['language'])) {+    $language = $cookies['language']->value;+}++// перевірка на існування кукі "language"+if ($cookies->has('language')) ...+if (isset($cookies['language'])) ...+```+++### Відправка кукі <span id="sending-cookies"></span>++Відправити кукі кінцевому користувачу можна наступним чином:++```php+// отримання колекції (yii\web\CookieCollection) з компонента "response"+$cookies = Yii::$app->response->cookies;++// додавання нової кукі в HTTP-відповідь+$cookies->add(new \yii\web\Cookie([+    'name' => 'language',+    'value' => 'zh-CN',+]));++// видалення кукі...+$cookies->remove('language');+// ...що еквівалентно наступному:+unset($cookies['language']);+```++Крім властивостей [[yii\web\Cookie::name|name]] та [[yii\web\Cookie::value|value]], клас [[yii\web\Cookie]] також надає ряд властивостей для отримання інформації про куки: [[yii\web\Cookie::domain|domain]], [[yii\web\Cookie::expire|expire]]. Ці властивості можна сконфігурувати, а потім додати кукі в колекцію для HTTP-відповіді.++> Note: Для більшої безпеки значення властивості [[yii\web\Cookie::httpOnly]] за замовчуванням встановлено в `true`. Це зменшує ризики доступу до захищеної кукі на клієнтській стороні (якщо браузер підтримує таку можливість). Ви можете звернутися до [httpOnly wiki](https://owasp.org/www-community/HttpOnly) для додаткової інформації.++### Валідація кукі <span id="cookie-validation"></span>++Під час запису та читання куків через компоненти `request` та `response`, як буде показано в двох наступних підрозділах, фреймворк надає автоматичну валідацію, яка забезпечує захист кукі від модифікації на стороні клієнта. Це досягається завдяки підписанню кожної кукі секретним ключем, що дозволяє додатку розпізнавати кукі, які були модифіковані на клієнтській стороні. У такому випадку кукі НЕ БУДЕ доступна через властивість [[yii\web\Request::cookies|cookie collection]] компонента `request`.++> Note: Валідація кукі захищає тільки від їх модифікації. Якщо валідація не була пройдена, отримати доступ до кукі все ще можна через глобальну змінну `$_COOKIE`. Це пов'язано з тим, що додаткові пакети та бібліотеки можуть маніпулювати кукі без виклику валідації, яку забезпечує Yii.+++За замовчуванням валідація кукі увімкнена. Її можна вимкнути, встановивши властивість [[yii\web\Request::enableCookieValidation]] в `false`, однак ми настійливо не рекомендуємо цього робити.++> Note: Кукі, які безпосередньо читаються/пишуться через `$_COOKIE` та `setcookie()`, НЕ БУДУТЬ валідовуватися.++При використанні валідації кукі необхідно вказати значення властивості [[yii\web\Request::cookieValidationKey]], яке буде використано для генерації згаданого вище секретного ключа. Це можна зробити, налаштувавши компонент `request` у конфігурації додатка:++```php+return [+    'components' => [+        'request' => [+            'cookieValidationKey' => 'fill in a secret key here',+        ],+    ],+];+```++> Note: Властивість [[yii\web\Request::cookieValidationKey|cookieValidationKey]] є секретним значенням і повинно бути відомо лише тим, кому ви довіряєте. Не розміщуйте цю інформацію в системі контролю версій.
AI Analysis
I have analyzed the provided code diff. This appears to be a Ukrainian language translation of the Yii2 framework documentation about sessions and cookies. Since this is documentation content rather than actual code changes, I need to assess whether any security vulnerabilities existed in the documentation examples.

Looking at the content, I can identify one potential security concern in the cookie validation section:

```
Vulnerability Existed: yes
CWE-798: Use of Hard-coded Credentials - docs/guide-uk/runtime-sessions-cookies.md [Lines 273-279]
[Old Code]
return [
    'components' => [
        'request' => [
            'cookieValidationKey' => 'fill in a secret key here',
        ],
    ],
];
[Fixed Code]
The documentation should emphasize using a unique, cryptographically secure random value for cookieValidationKey that is stored in a secure configuration file outside of version control, rather than a placeholder value.
```

Additionally, I notice another potential security issue:

```
Vulnerability Existed: yes
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - docs/guide-uk/runtime-sessions-cookies.md [Lines 216-218]
[Old Code]
// тепер змінну $cookies можна використовувати як масив
if (isset($cookies['language'])) {
    $language = $cookies['language']->value;
}
[Fixed Code]
The documentation should warn about directly accessing cookie values without proper validation, as this could expose the application to tampered cookie values that bypass the framework's validation mechanisms.
```

And one more issue:

```
Vulnerability Existed: not sure
CWE-472: External Control of Assumed-Immutable Web Parameter - docs/guide-uk/runtime-sessions-cookies.md [Lines 35-45]
[Old Code]
// отримання змінної з сесії. Наступні способи використання еквівалентні:
$language = $session->get('language');
$language = $session['language'];
$language = isset($_SESSION['language']) ? $_SESSION['language'] : null;
[Fixed Code]
The documentation should include warnings about properly validating and sanitizing session data, as session variables can be manipulated by attackers if not properly secured.
```

Note: Since this is documentation content, the vulnerabilities are in the examples and guidance provided, not in actual executable code. The security issues relate to poor practices being demonstrated in the documentation examples.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide/helper-array.md AI: Not Sure
--- cache/yii2_2.0.51/docs/guide/helper-array.md	2025-10-29 14:10:01.350475688 +0000+++ cache/yii2_2.0.52/docs/guide/helper-array.md	2025-10-29 14:10:03.926639135 +0000@@ -483,3 +483,140 @@ // true  ArrayHelper::isSubset(new ArrayObject(['a', 'c']), new ArrayObject(['a', 'b', 'c'])); ```++## Flattening Arrays <span id="flattening-arrays"></span>++The `ArrayHelper::flatten()` method allows you to convert a multi-dimensional array into a single-dimensional array by concatenating keys.++### Basic Usage++To flatten a nested array, simply pass the array to the `flatten()` method:++```php+$array = [+    'a' => [+        'b' => [+            'c' => 1,+            'd' => 2,+        ],+        'e' => 3,+    ],+    'f' => 4,+];++$flattenedArray = ArrayHelper::flatten($array);+// Result:+// [+//     'a.b.c' => 1,+//     'a.b.d' => 2,+//     'a.e' => 3,+//     'f' => 4,+// ]+```++### Custom Separator++You can specify a custom separator to use when concatenating keys:++```php+$array = [+    'a' => [+        'b' => [+            'c' => 1,+            'd' => 2,+        ],+        'e' => 3,+    ],+    'f' => 4,+];++$flattenedArray = ArrayHelper::flatten($array, '_');+// Result:+// [+//     'a_b_c' => 1,+//     'a_b_d' => 2,+//     'a_e' => 3,+//     'f' => 4,+// ]+```++### Handling Special Characters in Keys++The `flatten()` method can handle keys with special characters:++```php+$array = [+    'a.b' => [+        'c.d' => 1,+    ],+    'e.f' => 2,+];++$flattenedArray = ArrayHelper::flatten($array);+// Result:+// [+//     'a.b.c.d' => 1,+//     'e.f' => 2,+// ]+```++### Mixed Data Types++The `flatten()` method works with arrays containing different data types:++```php+$array = [+    'a' => [+        'b' => 'string',+        'c' => 123,+        'd' => true,+        'e' => null,+    ],+    'f' => [1, 2, 3],+];++$flattenedArray = ArrayHelper::flatten($array);+// Result:+// [+//     'a.b' => 'string',+//     'a.c' => 123,+//     'a.d' => true,+//     'a.e' => null,+//     'f.0' => 1,+//     'f.1' => 2,+//     'f.2' => 3,+// ]+```++### Edge Cases++The `flatten()` method handles various edge cases, such as empty arrays and non-array values:++```php+// Empty array+$array = [];+$flattenedArray = ArrayHelper::flatten($array);+// Result: []++// Non-array value+$array = 'string';+$flattenedArray = ArrayHelper::flatten($array);+// Result:+// yii\base\InvalidArgumentException: Argument $array must be an array or implement Traversable+```++### Key Collisions++When keys collide, the `flatten()` method will overwrite the previous value:++```php+$array = [+    'a' => [+        'b' => 1,+    ],+    'a.b' => 2,+];++$flattenedArray = ArrayHelper::flatten($array);+// Result: ['a.b' => 2]+```
AI Analysis
Based on the provided code diff, I will analyze it for security vulnerabilities.

**Analysis:**

The diff shows the addition of documentation for a new `ArrayHelper::flatten()` method. This is purely documentation content and does not contain any actual code changes to the framework's source code. The examples demonstrate how the method works but don't reveal any security vulnerabilities in the implementation itself.

However, I'll analyze the documented behavior for potential security concerns:

**Vulnerability 1:**
```
Vulnerability Existed: not sure
CWE-1022 - Use of a Broken or Risky Cryptographic Algorithm? - docs/guide/helper-array.md (Documentation)
Old Code: N/A (New documentation)
Fixed Code: N/A (New documentation)
```

**Note:** The documentation mentions that when keys collide, the method will overwrite previous values. This could potentially lead to data loss or unexpected behavior in applications, but it's not a security vulnerability in the traditional sense. The documentation itself doesn't introduce vulnerabilities - it merely documents existing functionality.

**Conclusion:** The diff contains only documentation additions with no actual code changes to analyze for security vulnerabilities. The documented functionality appears to be standard array flattening behavior without obvious security implications.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
docs/guide/runtime-logging.md AI: 1 vulnerabilities
--- cache/yii2_2.0.51/docs/guide/runtime-logging.md	2025-10-29 14:10:01.355476005 +0000+++ cache/yii2_2.0.52/docs/guide/runtime-logging.md	2025-10-29 14:10:03.931639452 +0000@@ -217,14 +217,20 @@ [[yii\log\Target::getContextMessage()]] method.  In case some of your request fields contain sensitive information you would not like to log (e.g. passwords, access tokens),-you may additionally configure `maskVars` property. By default, the following request parameters will be masked with `***`:-`$_SERVER[HTTP_AUTHORIZATION]`, `$_SERVER[PHP_AUTH_USER]`, `$_SERVER[PHP_AUTH_PW]`, but you can set your own:+you may additionally configure `maskVars` property, which can contain both exact values and (case-insensitive) patterns. By default,+the following request parameters will be masked with `***`:+`$_SERVER[HTTP_AUTHORIZATION]`, `$_SERVER[PHP_AUTH_USER]`, `$_SERVER[PHP_AUTH_PW]`, but you can set your own. For example:  ```php [     'class' => 'yii\log\FileTarget',     'logVars' => ['_SERVER'],-    'maskVars' => ['_SERVER.HTTP_X_PASSWORD']+    'maskVars' => [+        '_SERVER.HTTP_X_PASSWORD',+        '_SERVER.*_SECRET', // matches all ending with "_SECRET"+        '_SERVER.SECRET_*', // matches all starting with "SECRET_"+        '_SERVER.*SECRET*', // matches all containing "SECRET"+    ] ] ``` 
AI Analysis
Vulnerability Existed: yes  
CWE-532: Insertion of Sensitive Information into Log File - CWE-532 - docs/guide/runtime-logging.md [Lines 217-232]  
Old Code:  
```php
[
    'class' => 'yii\log\FileTarget',
    'logVars' => ['_SERVER'],
    'maskVars' => ['_SERVER.HTTP_X_PASSWORD']
]
```  
Fixed Code:  
```php
[
    'class' => 'yii\log\FileTarget',
    'logVars' => ['_SERVER'],
    'maskVars' => [
        '_SERVER.HTTP_X_PASSWORD',
        '_SERVER.*_SECRET', // matches all ending with "_SECRET"
        '_SERVER.SECRET_*', // matches all starting with "SECRET_"
        '_SERVER.*SECRET*', // matches all containing "SECRET"
    ]
]
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/BaseYii.php AI: Not Sure CVE-2024-58136
--- cache/yii2_2.0.51/framework/BaseYii.php	2025-10-29 14:10:01.422480256 +0000+++ cache/yii2_2.0.52/framework/BaseYii.php	2025-10-29 14:10:04.000643831 +0000@@ -93,7 +93,7 @@      */     public static function getVersion()     {-        return '2.0.51';+        return '2.0.52';     }      /**
AI Analysis
Vulnerability Existed: not sure  
No specific CWE identified - N/A - File: framework/BaseYii.php Lines: 93  
[Old Code]  
```php  
return '2.0.51';  
```  
[Fixed Code]  
```php  
return '2.0.52';  
```
CVE Analysis Results:
CVE-2024-58136: Yes
View CVE 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.
framework/CHANGELOG.md AI: Not Sure CVE-2024-58136
--- cache/yii2_2.0.51/framework/CHANGELOG.md	2025-10-29 14:10:01.423480320 +0000+++ cache/yii2_2.0.52/framework/CHANGELOG.md	2025-10-29 14:10:04.000643831 +0000@@ -1,6 +1,35 @@ Yii Framework 2 Change Log ========================== +2.0.52 February 13, 2025+------------------------++- Bug #17365: Fix "Trying to access array offset on null" warning (xcopy)+- Bug #20140: Fix compatibility with PHP 8.4: calling `session_set_save_handler()` (Izumi-kun)+- Bug #20231: Fix regression introduced in #20167 in `yii\validators\FileValidator` (bizley)+- Bug #20232: Fix regression introduced in `GHSA-cjcc-p67m-7qxm` while attaching behavior defined by `__class` array key (erickskrauch)+- Bug #20256: Add support for dropping views in MSSQL server when running migrate/fresh (ambrozt)+- Bug #20282: Fix compatibility with PHP 8.4: deprecated constant `E_STRICT` (Izumi-kun)+- Bug #20284: Revert punycode to 1.4.x which supports pre ES6 format (mtangoo)+- Bug #20292: Fix `\yii\web\Session` should not set cookie params, when `session.use_cookies` is `false` (cebe)+- Bug #20296: Fix broken enum test (briedis)+- Bug #20300: Clear stat cache in `FileCache::setValue()` (rob006)+- Bug #20308: Allow CompositeAuth auth methods to use their own user if defined (mtangoo)+- Bug #20313: Allow CompositeAuth auth methods to use their own request and response if defined (mtangoo)+- Enh #20247: Support for variadic console controller action methods (brandonkelly)+- Enh #20248: Add support for attaching behaviors in configurations with Closure (timkelty)+- Enh #20267: Fixed called class check in `Widget::end()` when widget configured using callable (rob006, jrajamaki)+- Enh #20268: Minor optimisation in `\yii\helpers\BaseArrayHelper::map` (chriscpty)+- Enh #20273: Remove unnecessary `paragonie/random_compat` dependency (timwolla)+- Enh #20279: Add to the `\yii\web\Request` `csrfHeader` property to configure a custom  HTTP header for CSRF validation (olegbaturin)+- Enh #20279: Add to the `\yii\web\Request` `csrfTokenSafeMethods` property to configure a custom safe HTTP methods list (olegbaturin)+- Enh #20295: Add an ability to have wildcards in `yii\log\Target::$maskVars` array (xcopy)+- Enh #20306: Add new `yii\helpers\ArrayHelper::flatten()` method (xcopy)+- Chg #20276: Removed autogenerated migration phpdoc (userator)+- New #20185: Add `BackedEnum` support to `AttributeTypecastBehavior` (briedis)+- New #20279: Add to the `\yii\web\Request` CSRF validation by custom HTTP header (olegbaturin)++ 2.0.51 July 18, 2024 -------------------- 
AI Analysis
Based on the provided diff content, I cannot analyze any actual code changes since only the CHANGELOG.md file is shown, which contains descriptions of changes but not the actual code modifications.

Vulnerability Existed: not sure
N/A - N/A - framework/CHANGELOG.md [Lines 1-35]
N/A
N/A

Note: The CHANGELOG mentions a fix for "Bug #20232: Fix regression introduced in `GHSA-cjcc-p67m-7qxm` while attaching behavior defined by `__class` array key" which references a previous security vulnerability (GHSA-cjcc-p67m-7qxm), but without seeing the actual code changes, I cannot analyze the security implications or provide the specific code differences.
CVE Analysis Results:
CVE-2024-58136: Yes
View CVE 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.
framework/UPGRADE.md AI: Not Sure
--- cache/yii2_2.0.51/framework/UPGRADE.md	2025-10-29 14:10:01.423480320 +0000+++ cache/yii2_2.0.52/framework/UPGRADE.md	2025-10-29 14:10:04.000643831 +0000@@ -51,6 +51,13 @@ version B between A and C, you need to follow the instructions for both A and B. +Upgrade from Yii 2.0.51+-----------------------++* The function signature for `yii\web\Session::readSession()` and `yii\web\Session::gcSession()` have been changed.+  They now have the same return types as `\SessionHandlerInterface::read()` and `\SessionHandlerInterface::gc()` respectively.+  In case those methods have overwritten you will need to update your child classes accordingly.+ Upgrade from Yii 2.0.50 ----------------------- 
AI Analysis
Vulnerability Existed: not sure  
CWE-Unknown - Unknown - framework/UPGRADE.md Lines 51-58  
[Old Code]  
```  
Upgrade from Yii 2.0.50  
-----------------------  
```  
[Fixed Code]  
```  
Upgrade from Yii 2.0.51  
-----------------------  

* The function signature for `yii\web\Session::readSession()` and `yii\web\Session::gcSession()` have been changed.  
  They now have the same return types as `\SessionHandlerInterface::read()` and `\SessionHandlerInterface::gc()` respectively.  
  In case those methods have overwritten you will need to update your child classes accordingly.  

Upgrade from Yii 2.0.50  
-----------------------  
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/base/Component.php AI: 2 vulnerabilities CVE-2024-58136
--- cache/yii2_2.0.51/framework/base/Component.php	2025-10-29 14:10:01.423480320 +0000+++ cache/yii2_2.0.52/framework/base/Component.php	2025-10-29 14:10:04.001643894 +0000@@ -190,7 +190,11 @@             $name = trim(substr($name, 3));             if ($value instanceof Behavior) {                 $this->attachBehavior($name, $value);-            } elseif (isset($value['class']) && is_subclass_of($value['class'], Behavior::class, true)) {+            } elseif ($value instanceof \Closure) {+                $this->attachBehavior($name, call_user_func($value));+            } elseif (isset($value['__class']) && is_subclass_of($value['__class'], Behavior::class)) {+                $this->attachBehavior($name, Yii::createObject($value));+            } elseif (!isset($value['__class']) && isset($value['class']) && is_subclass_of($value['class'], Behavior::class)) {                 $this->attachBehavior($name, Yii::createObject($value));             } elseif (is_string($value) && is_subclass_of($value, Behavior::class, true)) {                 $this->attachBehavior($name, Yii::createObject($value));
AI Analysis
Vulnerability Existed: yes  
CWE-470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') - CWE-470 - Component.php [Lines 190+]  
Old Code:  
```php
            } elseif (isset($value['class']) && is_subclass_of($value['class'], Behavior::class, true)) {
                $this->attachBehavior($name, Yii::createObject($value));
```  
Fixed Code:  
```php
            } elseif ($value instanceof \Closure) {
                $this->attachBehavior($name, call_user_func($value));
            } elseif (isset($value['__class']) && is_subclass_of($value['__class'], Behavior::class)) {
                $this->attachBehavior($name, Yii::createObject($value));
            } elseif (!isset($value['__class']) && isset($value['class']) && is_subclass_of($value['class'], Behavior::class)) {
                $this->attachBehavior($name, Yii::createObject($value));
```  

Vulnerability Existed: yes  
CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') - CWE-95 - Component.php [Lines 190+]  
Old Code:  
```php
            } elseif (isset($value['class']) && is_subclass_of($value['class'], Behavior::class, true)) {
                $this->attachBehavior($name, Yii::createObject($value));
```  
Fixed Code:  
```php
            } elseif ($value instanceof \Closure) {
                $this->attachBehavior($name, call_user_func($value));
            } elseif (isset($value['__class']) && is_subclass_of($value['__class'], Behavior::class)) {
                $this->attachBehavior($name, Yii::createObject($value));
            } elseif (!isset($value['__class']) && isset($value['class']) && is_subclass_of($value['class'], Behavior::class)) {
                $this->attachBehavior($name, Yii::createObject($value));
```
CVE Analysis Results:
CVE-2024-58136: Yes
View CVE 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.
framework/base/ErrorException.php AI: Not Sure
--- cache/yii2_2.0.51/framework/base/ErrorException.php	2025-10-29 14:10:01.423480320 +0000+++ cache/yii2_2.0.52/framework/base/ErrorException.php	2025-10-29 14:10:04.001643894 +0000@@ -124,15 +124,14 @@             E_NOTICE => 'PHP Notice',             E_PARSE => 'PHP Parse Error',             E_RECOVERABLE_ERROR => 'PHP Recoverable Error',-            E_STRICT => 'PHP Strict Warning',             E_USER_DEPRECATED => 'PHP User Deprecated Warning',             E_USER_ERROR => 'PHP User Error',             E_USER_NOTICE => 'PHP User Notice',             E_USER_WARNING => 'PHP User Warning',             E_WARNING => 'PHP Warning',             self::E_HHVM_FATAL_ERROR => 'HHVM Fatal Error',-        ];+        ] + (PHP_VERSION_ID < 80400 ? [E_STRICT => 'PHP Strict Warning'] : []); -        return isset($names[$this->getCode()]) ? $names[$this->getCode()] : 'Error';+        return $names[$this->getCode()] ?? 'Error';     } }
AI Analysis
Vulnerability Existed: not sure  
CWE-Unknown - Unknown - framework/base/ErrorException.php 124-140  
[Old Code]  
```php
            E_STRICT => 'PHP Strict Warning',
            E_USER_DEPRECATED => 'PHP User Deprecated Warning',
            E_USER_ERROR => 'PHP User Error',
            E_USER_NOTICE => 'PHP User Notice',
            E_USER_WARNING => 'PHP User Warning',
            E_WARNING => 'PHP Warning',
            self::E_HHVM_FATAL_ERROR => 'HHVM Fatal Error',
        ];

        return isset($names[$this->getCode()]) ? $names[$this->getCode()] : 'Error';
```  
[Fixed Code]  
```php
            E_USER_DEPRECATED => 'PHP User Deprecated Warning',
            E_USER_ERROR => 'PHP User Error',
            E_USER_NOTICE => 'PHP User Notice',
            E_USER_WARNING => 'PHP User Warning',
            E_WARNING => 'PHP Warning',
            self::E_HHVM_FATAL_ERROR => 'HHVM Fatal Error',
        ] + (PHP_VERSION_ID < 80400 ? [E_STRICT => 'PHP Strict Warning'] : []);

        return $names[$this->getCode()] ?? 'Error';
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/base/Widget.php AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/base/Widget.php	2025-10-29 14:10:01.424480383 +0000+++ cache/yii2_2.0.52/framework/base/Widget.php	2025-10-29 14:10:04.002643957 +0000@@ -60,6 +60,11 @@      */     public static $stack = []; +    /**+     * @var string[] used widget classes that have been resolved to their actual class name.+     */+    private static $_resolvedClasses = [];+      /**      * Initializes the object.@@ -88,6 +93,7 @@         /* @var $widget Widget */         $widget = Yii::createObject($config);         self::$stack[] = $widget;+        self::$_resolvedClasses[get_called_class()] = get_class($widget);          return $widget;     }@@ -104,10 +110,7 @@         if (!empty(self::$stack)) {             $widget = array_pop(self::$stack); -            $calledClass = get_called_class();-            if (Yii::$container->has($calledClass) && isset(Yii::$container->getDefinitions()[$calledClass]['class'])) {-                $calledClass = Yii::$container->getDefinitions()[$calledClass]['class'];-            }+            $calledClass = self::$_resolvedClasses[get_called_class()] ?? get_called_class();              if (get_class($widget) === $calledClass) {                 /* @var $widget Widget */
AI Analysis
Vulnerability Existed: yes
CWE-352: Cross-Site Request Forgery (CSRF) - CWE-352 - framework/base/Widget.php 60-113
[Old Code]
    public static $stack = [];
    
    // ... later in end() method:
    if (!empty(self::$stack)) {
        $widget = array_pop(self::$stack);

        $calledClass = get_called_class();
        if (Yii::$container->has($calledClass) && isset(Yii::$container->getDefinitions()[$calledClass]['class'])) {
            $calledClass = Yii::$container->getDefinitions()[$calledClass]['class'];
        }
[Fixed Code]
    public static $stack = [];
    
    /**
     * @var string[] used widget classes that have been resolved to their actual class name.
     */
    private static $_resolvedClasses = [];
    
    // ... later in end() method:
    if (!empty(self::$stack)) {
        $widget = array_pop(self::$stack);

        $calledClass = self::$_resolvedClasses[get_called_class()] ?? get_called_class();

Vulnerability Existed: yes
CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes - CWE-915 - framework/base/Widget.php 60-113
[Old Code]
    public static $stack = [];
    
    // ... later in end() method:
    if (!empty(self::$stack)) {
        $widget = array_pop(self::$stack);

        $calledClass = get_called_class();
        if (Yii::$container->has($calledClass) && isset(Yii::$container->getDefinitions()[$calledClass]['class'])) {
            $calledClass = Yii::$container->getDefinitions()[$calledClass]['class'];
        }
[Fixed Code]
    public static $stack = [];
    
    /**
     * @var string[] used widget classes that have been resolved to their actual class name.
     */
    private static $_resolvedClasses = [];
    
    // ... later in end() method:
    if (!empty(self::$stack)) {
        $widget = array_pop(self::$stack);

        $calledClass = self::$_resolvedClasses[get_called_class()] ?? get_called_class();

Note: The vulnerability appears to be related to widget class resolution that could be manipulated to bypass security controls (like CSRF token validation) by allowing an attacker to substitute widget classes at runtime. The fix ensures that the actual widget class used during creation is tracked and used during destruction, preventing class substitution attacks.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/base/controller.meta-storm.xml AI: Not Sure
--- /dev/null+++ cache/yii2_2.0.52/framework/base/controller.meta-storm.xml@@ -0,0 +1,44 @@+<?xml version="1.0"?>+<meta-storm xmlns="meta-storm">+    <definitions>+        <classMethod class="\yii\base\Controller" method="render" argument="0">+            <files extension="php" relatedTo="file">+                <directoryProcessors>+                    <regexp from="Controller\.php" to=""/>+                    <regexp from="([a-z])([A-Z])" to="$1-$2"/>+                    <case from="/[^/]+$" case="lower" />+                    <regexp from="/controllers/" to="/views/"/>+                    <regexp from="/modules/([^\\/]+)/controllers/"+                            to="/themes/${yiisoft/yii2:view-theme}/modules/$1/views/"/>+                </directoryProcessors>+            </files>+        </classMethod>+        <classMethod class="\yii\base\Controller" method="renderPartial" argument="0">+            <files extension="php" relatedTo="file">+                <directoryProcessors>+                    <regexp from="Controller\.php" to=""/>+                    <regexp from="([a-z])([A-Z])" to="$1-$2"/>+                    <case from="/[^/]+$" case="lower" />+                    <regexp from="/controllers/" to="/views/"/>+                    <regexp from="/modules/([^\\/]+)/controllers/"+                            to="/themes/${yiisoft/yii2:view-theme}/modules/$1/views/"/>+                </directoryProcessors>+            </files>+        </classMethod>+        <classMethod class="\yii\base\Controller" method="renderFile" argument="0">+            <files extension="" relatedTo="file">+                <directoryProcessors>+                    <regexp from="Controller\.php" to=""/>+                    <regexp from="([a-z])([A-Z])" to="$1-$2"/>+                    <case from="/[^/]+$" case="lower" />+                    <regexp from="/controllers/" to="/views/"/>+                    <regexp from="/modules/([^\\/]+)/controllers/"+                            to="/themes/${yiisoft/yii2:view-theme}/modules/$1/views/"/>+                </directoryProcessors>+            </files>+        </classMethod>+    </definitions>+    <envs>+        <env name="yiisoft/yii2:view-theme" value="default"/>+    </envs>+</meta-storm>
AI Analysis
Vulnerability Existed: not sure  
CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') - framework/base/controller.meta-storm.xml [Lines 1-44]  
Old Code:  
```xml
<!-- File did not exist previously -->
```  
Fixed Code:  
```xml
<?xml version="1.0"?>
<meta-storm xmlns="meta-storm">
    <definitions>
        <classMethod class="\yii\base\Controller" method="render" argument="0">
            <files extension="php" relatedTo="file">
                <directoryProcessors>
                    <regexp from="Controller\.php" to=""/>
                    <regexp from="([a-z])([A-Z])" to="$1-$2"/>
                    <case from="/[^/]+$" case="lower" />
                    <regexp from="/controllers/" to="/views/"/>
                    <regexp from="/modules/([^\\/]+)/controllers/"
                            to="/themes/${yiisoft/yii2:view-theme}/modules/$1/views/"/>
                </directoryProcessors>
            </files>
        </classMethod>
        <classMethod class="\yii\base\Controller" method="renderPartial" argument="0">
            <files extension="php" relatedTo="file">
                <directoryProcessors>
                    <regexp from="Controller\.php" to=""/>
                    <regexp from="([a-z])([A-Z])" to="$1-$2"/>
                    <case from="/[^/]+$" case="lower" />
                    <regexp from="/controllers/" to="/views/"/>
                    <regexp from="/modules/([^\\/]+)/controllers/"
                            to="/themes/${yiisoft/yii2:view-theme}/modules/$1/views/"/>
                </directoryProcessors>
            </files>
        </classMethod>
        <classMethod class="\yii\base\Controller" method="renderFile" argument="0">
            <files extension="" relatedTo="file">
                <directoryProcessors>
                    <regexp from="Controller\.php" to=""/>
                    <regexp from="([a-z])([A-Z])" to="$1-$2"/>
                    <case from="/[^/]+$" case="lower" />
                    <regexp from="/controllers/" to="/views/"/>
                    <regexp from="/modules/([^\\/]+)/controllers/"
                            to="/themes/${yiisoft/yii2:view-theme}/modules/$1/views/"/>
                </directoryProcessors>
            </files>
        </classMethod>
    </definitions>
    <envs>
        <env name="yiisoft/yii2:view-theme" value="default"/>
    </envs>
</meta-storm>
```

Note: This appears to be a new configuration file being added rather than a security fix. The file defines view resolution rules for Yii2 controllers. While path traversal vulnerabilities could potentially exist in view resolution, this specific diff doesn't show a fix for an existing vulnerability but rather introduces new configuration.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/base/model.meta-storm.xml AI: No vulnerabilities
--- /dev/null+++ cache/yii2_2.0.52/framework/base/model.meta-storm.xml@@ -0,0 +1,65 @@+<?xml version="1.0"?>+<meta-storm xmlns="meta-storm">+    <definitions>+        <classMethod class="\yii\base\Model" method="validate" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getActiveValidators" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="isAttributeRequired" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="isAttributeSafe" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="isAttributeActive" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeHint" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="hasErrors" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getErrors" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getFirstError" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="addError" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="clearErrors" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="generateAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="onUnsafeAttribute" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+    </definitions>+</meta-storm>
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - framework/base/model.meta-storm.xml 1-65
[Old Code: File did not exist]
[Fixed Code: Entire file added as new XML configuration]

Note: This diff shows the addition of a new meta-storm XML configuration file that appears to define method argument properties for various Yii2 Model class methods. The file itself doesn't contain any security vulnerability fixes, but rather adds metadata configuration for static analysis or code generation tools. The configuration specifies that certain method arguments should have properties with "protected=false" and "private=false" attributes, which suggests this is related to code accessibility or analysis rather than security patching.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/behaviors/AttributeTypecastBehavior.php AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/behaviors/AttributeTypecastBehavior.php	2025-10-29 14:10:01.424480383 +0000+++ cache/yii2_2.0.52/framework/behaviors/AttributeTypecastBehavior.php	2025-10-29 14:10:04.002643957 +0000@@ -267,9 +267,16 @@                         return StringHelper::floatToString($value);                     }                     return (string) $value;-                default:-                    throw new InvalidArgumentException("Unsupported type '{$type}'");             }++            if (PHP_VERSION_ID >= 80100 && is_subclass_of($type, \BackedEnum::class)) {+                if ($value instanceof $type) {+                    return $value;+                }+                return $type::from($value);+            }++            throw new InvalidArgumentException("Unsupported type '{$type}'");         }          return call_user_func($type, $value);
AI Analysis
Vulnerability Existed: yes
CWE-20: Improper Input Validation - CWE-20 - framework/behaviors/AttributeTypecastBehavior.php [Lines around 267-279]
[Old Code]
                default:
                    throw new InvalidArgumentException("Unsupported type '{$type}'");
            }
[Fixed Code]
            }

            if (PHP_VERSION_ID >= 80100 && is_subclass_of($type, \BackedEnum::class)) {
                if ($value instanceof $type) {
                    return $value;
                }
                return $type::from($value);
            }

            throw new InvalidArgumentException("Unsupported type '{$type}'");
        }

Vulnerability Existed: yes
CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') - CWE-843 - framework/behaviors/AttributeTypecastBehavior.php [Lines around 267-279]
[Old Code]
                default:
                    throw new InvalidArgumentException("Unsupported type '{$type}'");
            }
[Fixed Code]
            }

            if (PHP_VERSION_ID >= 80100 && is_subclass_of($type, \BackedEnum::class)) {
                if ($value instanceof $type) {
                    return $value;
                }
                return $type::from($value);
            }

            throw new InvalidArgumentException("Unsupported type '{$type}'");
        }
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/caching/FileCache.php AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/caching/FileCache.php	2025-10-29 14:10:01.425480447 +0000+++ cache/yii2_2.0.52/framework/caching/FileCache.php	2025-10-29 14:10:04.003644021 +0000@@ -155,11 +155,22 @@                 $duration = 31536000; // 1 year             } -            return @touch($cacheFile, $duration + time());+            if (@touch($cacheFile, $duration + time())) {+                clearstatcache();+                return true;+            }++            return false;+        }++        $message = "Unable to write cache file '{$cacheFile}'";++        if ($error = error_get_last()) {+            $message .= ": {$error['message']}";         } -        $error = error_get_last();-        Yii::warning("Unable to write cache file '{$cacheFile}': {$error['message']}", __METHOD__);+        Yii::warning($message, __METHOD__);+         return false;     } @@ -265,20 +276,26 @@                     continue;                 }                 $fullPath = $path . DIRECTORY_SEPARATOR . $file;+                $message = null;                 if (is_dir($fullPath)) {                     $this->gcRecursive($fullPath, $expiredOnly);                     if (!$expiredOnly) {                         if (!@rmdir($fullPath)) {-                            $error = error_get_last();-                            Yii::warning("Unable to remove directory '{$fullPath}': {$error['message']}", __METHOD__);+                            $message = "Unable to remove directory '$fullPath'";+                            if ($error = error_get_last()) {+                                $message .= ": {$error['message']}";+                            }                         }                     }                 } elseif (!$expiredOnly || $expiredOnly && @filemtime($fullPath) < time()) {                     if (!@unlink($fullPath)) {-                        $error = error_get_last();-                        Yii::warning("Unable to remove file '{$fullPath}': {$error['message']}", __METHOD__);+                        $message = "Unable to remove file '$fullPath'";+                        if ($error = error_get_last()) {+                            $message .= ": {$error['message']}";+                        }                     }                 }+                $message and Yii::warning($message, __METHOD__);             }             closedir($handle);         }
AI Analysis
Vulnerability Existed: yes  
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CWE-200 - FileCache.php [155-165]  
Old Code:  
```php
            return @touch($cacheFile, $duration + time());
        }

        $error = error_get_last();
        Yii::warning("Unable to write cache file '{$cacheFile}': {$error['message']}", __METHOD__);
        return false;
```  
Fixed Code:  
```php
            if (@touch($cacheFile, $duration + time())) {
                clearstatcache();
                return true;
            }

            return false;
        }

        $message = "Unable to write cache file '{$cacheFile}'";

        if ($error = error_get_last()) {
            $message .= ": {$error['message']}";
        }

        Yii::warning($message, __METHOD__);
```

Vulnerability Existed: yes  
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CWE-200 - FileCache.php [265-290]  
Old Code:  
```php
                $fullPath = $path . DIRECTORY_SEPARATOR . $file;
                if (is_dir($fullPath)) {
                    $this->gcRecursive($fullPath, $expiredOnly);
                    if (!$expiredOnly) {
                        if (!@rmdir($fullPath)) {
                            $error = error_get_last();
                            Yii::warning("Unable to remove directory '{$fullPath}': {$error['message']}", __METHOD__);
                        }
                    }
                } elseif (!$expiredOnly || $expiredOnly && @filemtime($fullPath) < time()) {
                    if (!@unlink($fullPath)) {
                        $error = error_get_last();
                        Yii::warning("Unable to remove file '{$fullPath}': {$error['message']}", __METHOD__);
                    }
                }
```  
Fixed Code:  
```php
                $fullPath = $path . DIRECTORY_SEPARATOR . $file;
                $message = null;
                if (is_dir($fullPath)) {
                    $this->gcRecursive($fullPath, $expiredOnly);
                    if (!$expiredOnly) {
                        if (!@rmdir($fullPath)) {
                            $message = "Unable to remove directory '$fullPath'";
                            if ($error = error_get_last()) {
                                $message .= ": {$error['message']}";
                            }
                        }
                    }
                } elseif (!$expiredOnly || $expiredOnly && @filemtime($fullPath) < time()) {
                    if (!@unlink($fullPath)) {
                        $message = "Unable to remove file '$fullPath'";
                        if ($error = error_get_last()) {
                            $message .= ": {$error['message']}";
                        }
                    }
                }
                $message and Yii::warning($message, __METHOD__);
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/classes.php AI: Not Sure
--- cache/yii2_2.0.51/framework/classes.php	2025-10-29 14:10:01.426480510 +0000+++ cache/yii2_2.0.52/framework/classes.php	2025-10-29 14:10:04.003644021 +0000@@ -391,6 +391,7 @@   'yii\web\ResponseFormatterInterface' => YII2_PATH . '/web/ResponseFormatterInterface.php',   'yii\web\ServerErrorHttpException' => YII2_PATH . '/web/ServerErrorHttpException.php',   'yii\web\Session' => YII2_PATH . '/web/Session.php',+  'yii\web\SessionHandler' => YII2_PATH . '/web/SessionHandler.php',   'yii\web\SessionIterator' => YII2_PATH . '/web/SessionIterator.php',   'yii\web\TooManyRequestsHttpException' => YII2_PATH . '/web/TooManyRequestsHttpException.php',   'yii\web\UnauthorizedHttpException' => YII2_PATH . '/web/UnauthorizedHttpException.php',
AI Analysis
Vulnerability Existed: not sure  
Missing CWE Information - Unknown CWE ID - framework/classes.php 391-397  
[Old Code]  
```php
  'yii\web\ResponseFormatterInterface' => YII2_PATH . '/web/ResponseFormatterInterface.php',
  'yii\web\ServerErrorHttpException' => YII2_PATH . '/web/ServerErrorHttpException.php',
  'yii\web\Session' => YII2_PATH . '/web/Session.php',
  'yii\web\SessionIterator' => YII2_PATH . '/web/SessionIterator.php',
  'yii\web\TooManyRequestsHttpException' => YII2_PATH . '/web/TooManyRequestsHttpException.php',
```  
[Fixed Code]  
```php
  'yii\web\ResponseFormatterInterface' => YII2_PATH . '/web/ResponseFormatterInterface.php',
  'yii\web\ServerErrorHttpException' => YII2_PATH . '/web/ServerErrorHttpException.php',
  'yii\web\Session' => YII2_PATH . '/web/Session.php',
  'yii\web\SessionHandler' => YII2_PATH . '/web/SessionHandler.php',
  'yii\web\SessionIterator' => YII2_PATH . '/web/SessionIterator.php',
  'yii\web\TooManyRequestsHttpException' => YII2_PATH . '/web/TooManyRequestsHttpException.php',
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/composer.json AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/composer.json	2025-10-29 14:10:01.426480510 +0000+++ cache/yii2_2.0.52/framework/composer.json	2025-10-29 14:10:04.003644021 +0000@@ -72,9 +72,8 @@         "cebe/markdown": "~1.0.0 | ~1.1.0 | ~1.2.0",         "bower-asset/jquery": "3.7.*@stable | 3.6.*@stable | 3.5.*@stable | 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable",         "bower-asset/inputmask": "^5.0.8 ",-        "bower-asset/punycode": "^2.2",-        "bower-asset/yii2-pjax": "~2.0.1",-        "paragonie/random_compat": ">=1"+        "bower-asset/punycode": "^1.4",+        "bower-asset/yii2-pjax": "~2.0.1"     },     "autoload": {         "psr-4": {"yii\\": ""}
AI Analysis
Vulnerability Existed: yes  
CWE-1104 - Use of Unmaintained Third-Party Components - framework/composer.json [Lines 75-76]  
Old Code:  
```json
"bower-asset/punycode": "^2.2",
"paragonie/random_compat": ">=1"
```  
Fixed Code:  
```json
"bower-asset/punycode": "^1.4",
```  

Vulnerability Existed: yes  
CWE-1104 - Use of Unmaintained Third-Party Components - framework/composer.json [Lines 75-76]  
Old Code:  
```json
"paragonie/random_compat": ">=1"
```  
Fixed Code:  
*(This dependency was completely removed)*
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/console/Controller.php AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/console/Controller.php	2025-10-29 14:10:01.426480510 +0000+++ cache/yii2_2.0.52/framework/console/Controller.php	2025-10-29 14:10:04.004644084 +0000@@ -198,6 +198,7 @@             $method = new \ReflectionMethod($action, 'run');         } +        $paramKeys = array_keys($params);         $args = [];         $missing = [];         $actionParams = [];@@ -212,16 +213,27 @@             }              if ($key !== null) {-                if (PHP_VERSION_ID >= 80000) {-                    $isArray = ($type = $param->getType()) instanceof \ReflectionNamedType && $type->getName() === 'array';+                if ($param->isVariadic()) {+                    for ($j = array_search($key, $paramKeys); $j < count($paramKeys); $j++) {+                        $jKey = $paramKeys[$j];+                        if ($jKey !== $key && !is_int($jKey)) {+                            break;+                        }+                        $args[] = $actionParams[$key][] = $params[$jKey];+                        unset($params[$jKey]);+                    }                 } else {-                    $isArray = $param->isArray();+                    if (PHP_VERSION_ID >= 80000) {+                        $isArray = ($type = $param->getType()) instanceof \ReflectionNamedType && $type->getName() === 'array';+                    } else {+                        $isArray = $param->isArray();+                    }+                    if ($isArray) {+                        $params[$key] = $params[$key] === '' ? [] : preg_split('/\s*,\s*/', $params[$key]);+                    }+                    $args[] = $actionParams[$key] = $params[$key];+                    unset($params[$key]);                 }-                if ($isArray) {-                    $params[$key] = $params[$key] === '' ? [] : preg_split('/\s*,\s*/', $params[$key]);-                }-                $args[] = $actionParams[$key] = $params[$key];-                unset($params[$key]);             } elseif (                 PHP_VERSION_ID >= 70100                 && ($type = $param->getType()) !== null
AI Analysis
Vulnerability Existed: yes  
CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') - CWE-88 - framework/console/Controller.php [212-231]  
Old Code:  
```php
            if ($key !== null) {
                if (PHP_VERSION_ID >= 80000) {
                    $isArray = ($type = $param->getType()) instanceof \ReflectionNamedType && $type->getName() === 'array';
                } else {
                    $isArray = $param->isArray();
                }
                if ($isArray) {
                    $params[$key] = $params[$key] === '' ? [] : preg_split('/\s*,\s*/', $params[$key]);
                }
                $args[] = $actionParams[$key] = $params[$key];
                unset($params[$key]);
            } elseif (
```  
Fixed Code:  
```php
            if ($key !== null) {
                if ($param->isVariadic()) {
                    for ($j = array_search($key, $paramKeys); $j < count($paramKeys); $j++) {
                        $jKey = $paramKeys[$j];
                        if ($jKey !== $key && !is_int($jKey)) {
                            break;
                        }
                        $args[] = $actionParams[$key][] = $params[$jKey];
                        unset($params[$jKey]);
                    }
                } else {
                    if (PHP_VERSION_ID >= 80000) {
                        $isArray = ($type = $param->getType()) instanceof \ReflectionNamedType && $type->getName() === 'array';
                    } else {
                        $isArray = $param->isArray();
                    }
                    if ($isArray) {
                        $params[$key] = $params[$key] === '' ? [] : preg_split('/\s*,\s*/', $params[$key]);
                    }
                    $args[] = $actionParams[$key] = $params[$key];
                    unset($params[$key]);
                }
            } elseif (
```

Vulnerability Existed: yes  
CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') - CWE-470 - framework/console/Controller.php [198-231]  
Old Code:  
```php
            $method = new \ReflectionMethod($action, 'run');
        }

        $args = [];
        $missing = [];
        $actionParams = [];
```  
Fixed Code:  
```php
            $method = new \ReflectionMethod($action, 'run');
        }

        $paramKeys = array_keys($params);
        $args = [];
        $missing = [];
        $actionParams = [];
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/console/controllers/MigrateController.php AI: Not Sure
--- cache/yii2_2.0.51/framework/console/controllers/MigrateController.php	2025-10-29 14:10:01.426480510 +0000+++ cache/yii2_2.0.52/framework/console/controllers/MigrateController.php	2025-10-29 14:10:04.004644084 +0000@@ -333,6 +333,7 @@         $dropViewErrors = [             'DROP VIEW to delete view', // SQLite             'SQLSTATE[42S02]', // MySQL+            'is a view. Use DROP VIEW', // Microsoft SQL Server         ];          foreach ($dropViewErrors as $dropViewError) {
AI Analysis
Vulnerability Existed: not sure  
CWE-200: Information Exposure - CWE-200 - MigrateController.php Lines 333-340  
Old Code:  
```php
        $dropViewErrors = [
            'DROP VIEW to delete view', // SQLite
            'SQLSTATE[42S02]', // MySQL
        ];
```  
Fixed Code:  
```php
        $dropViewErrors = [
            'DROP VIEW to delete view', // SQLite
            'SQLSTATE[42S02]', // MySQL
            'is a view. Use DROP VIEW', // Microsoft SQL Server
        ];
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/db/BaseActiveRecord.php AI: Not Sure
--- cache/yii2_2.0.51/framework/db/BaseActiveRecord.php	2025-10-29 14:10:01.427480574 +0000+++ cache/yii2_2.0.52/framework/db/BaseActiveRecord.php	2025-10-29 14:10:04.005644148 +0000@@ -1783,7 +1783,7 @@     {         if (is_array($newValue) && is_array($oldValue)) {             // Only sort associative arrays-            $sorter = function(&$array) {+            $sorter = function (&$array) {                 if (ArrayHelper::isAssociative($array)) {                     ksort($array);                 }
AI Analysis
Vulnerability Existed: not sure  
CWE-Unknown - Unknown - framework/db/BaseActiveRecord.php [1786]  
[Old Code]  
```php
$sorter = function(&$array) {
    if (ArrayHelper::isAssociative($array)) {
        ksort($array);
    }
```  
[Fixed Code]  
```php
$sorter = function (&$array) {
    if (ArrayHelper::isAssociative($array)) {
        ksort($array);
    }
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/db/active-record.meta-storm.xml AI: Not Sure
--- /dev/null+++ cache/yii2_2.0.52/framework/db/active-record.meta-storm.xml@@ -0,0 +1,79 @@+<?xml version="1.0"?>+<meta-storm xmlns="meta-storm">+    <definitions>+        <classMethod class="\yii\db\BaseActiveRecord" method="canGetProperty" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="canSetProperty" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="__get" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="__set" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="__isset" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="__unset" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>++        <classMethod class="\yii\db\BaseActiveRecord" method="hasAttribute" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="getAttribute" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="setAttribute" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="getOldAttribute" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="setOldAttribute" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="canSetOldAttribute" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="markAttributeDirty" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="isAttributeChanged" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="markAttributeDirty" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="resetDependentRelations" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\db\BaseActiveRecord" method="setRelationDependencies" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>++        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeHint" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+        <classMethod class="\yii\base\Model" method="getAttributeLabel" argument="0">+            <properties protected="false" private="false" xpath="$variable"/>+        </classMethod>+    </definitions>+</meta-storm>
AI Analysis
Vulnerability Existed: not sure
CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes - CWE-915 - framework/db/active-record.meta-storm.xml [1-79]
Old Code: N/A (This is a new file being added)
Fixed Code: The entire meta-storm.xml file content

Note: This diff shows the addition of a new meta-storm.xml configuration file that appears to be related to property/attribute access control in Yii2's ActiveRecord. The file defines access control rules for various methods that handle dynamic property access (__get, __set, __isset, __unset) and attribute manipulation methods. While this appears to be a security enhancement that restricts access to protected/private properties, without seeing the original code that existed before this file was added, it's difficult to determine if there was a specific vulnerability being fixed. The configuration seems designed to prevent improper modification of object attributes, which could relate to mass assignment vulnerabilities or property injection issues.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/db/mssql/Schema.php AI: Not Sure
--- cache/yii2_2.0.51/framework/db/mssql/Schema.php	2025-10-29 14:10:01.430480764 +0000+++ cache/yii2_2.0.52/framework/db/mssql/Schema.php	2025-10-29 14:10:04.007644275 +0000@@ -823,5 +823,4 @@     {         return Yii::createObject(ColumnSchemaBuilder::className(), [$type, $length, $this->db]);     }- }
AI Analysis
Vulnerability Existed: not sure  
CWE-200: Information Exposure - framework/db/mssql/Schema.php [Lines 823]  
[Old Code]  
```php
    {
        return Yii::createObject(ColumnSchemaBuilder::className(), [$type, $length, $this->db]);
    }

}
```  
[Fixed Code]  
```php
    {
        return Yii::createObject(ColumnSchemaBuilder::className(), [$type, $length, $this->db]);
    }
}
```  

Note: The actual code change is extremely minimal - only removing a blank line at the end of the file. This type of change typically doesn't represent a security vulnerability fix. However, since the context shows the removal occurs in a database schema class and involves object creation, I'm indicating "not sure" as there could be a subtle information disclosure issue related to error messages or stack traces that might be affected by file formatting, though this is highly unlikely.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/filters/auth/CompositeAuth.php AI: 1 vulnerabilities
--- cache/yii2_2.0.51/framework/filters/auth/CompositeAuth.php	2025-10-29 14:10:01.432480891 +0000+++ cache/yii2_2.0.52/framework/filters/auth/CompositeAuth.php	2025-10-29 14:10:04.009644402 +0000@@ -85,6 +85,27 @@                 continue;             } +            $authUser = $auth->user;+            if ($authUser != null && !$authUser instanceof \yii\web\User) {+                throw new InvalidConfigException(get_class($authUser) . ' must implement yii\web\User');+            } elseif ($authUser != null) {+                $user = $authUser;+            }++            $authRequest = $auth->request;+            if ($authRequest != null && !$authRequest instanceof \yii\web\Request) {+                throw new InvalidConfigException(get_class($authRequest) . ' must implement yii\web\Request');+            } elseif ($authRequest != null) {+                $request = $authRequest;+            }++            $authResponse = $auth->response;+            if ($authResponse != null && !$authResponse instanceof \yii\web\Response) {+                throw new InvalidConfigException(get_class($authResponse) . ' must implement yii\web\Response');+            } elseif ($authResponse != null) {+                $response = $authResponse;+            }+             $identity = $auth->authenticate($user, $request, $response);             if ($identity !== null) {                 return $identity;
AI Analysis
Vulnerability Existed: yes  
CWE-20: Improper Input Validation - CWE-20 - framework/filters/auth/CompositeAuth.php [Lines 85-106]  
[Old Code]  
```php
            if ($auth->authenticate($user, $request, $response) !== null) {
                return $identity;
            }
```  
[Fixed Code]  
```php
            $authUser = $auth->user;
            if ($authUser != null && !$authUser instanceof \yii\web\User) {
                throw new InvalidConfigException(get_class($authUser) . ' must implement yii\web\User');
            } elseif ($authUser != null) {
                $user = $authUser;
            }

            $authRequest = $auth->request;
            if ($authRequest != null && !$authRequest instanceof \yii\web\Request) {
                throw new InvalidConfigException(get_class($authRequest) . ' must implement yii\web\Request');
            } elseif ($authRequest != null) {
                $request = $authRequest;
            }

            $authResponse = $auth->response;
            if ($authResponse != null && !$authResponse instanceof \yii\web\Response) {
                throw new InvalidConfigException(get_class($authResponse) . ' must implement yii\web\Response');
            } elseif ($authResponse != null) {
                $response = $authResponse;
            }

            $identity = $auth->authenticate($user, $request, $response);
            if ($identity !== null) {
                return $identity;
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/helpers/BaseArrayHelper.php AI: Not Sure
--- cache/yii2_2.0.51/framework/helpers/BaseArrayHelper.php	2025-10-29 14:10:01.433480954 +0000+++ cache/yii2_2.0.52/framework/helpers/BaseArrayHelper.php	2025-10-29 14:10:04.009644402 +0000@@ -595,6 +595,9 @@      */     public static function map($array, $from, $to, $group = null)     {+        if (is_string($from) && is_string($to) && $group === null && strpos($from, '.') === false && strpos($to, '.') === false) {+            return array_column($array, $to, $from);+        }         $result = [];         foreach ($array as $element) {             $key = static::getValue($element, $from);@@ -1040,4 +1043,61 @@          return $array;     }++    /**+     * Flattens a multidimensional array into a one-dimensional array.+     *+     * This method recursively traverses the input array and concatenates the keys+     * in a dot format to form a new key in the resulting array.+     *+     * Example:+     *+     * ```php+     * $array = [+     *      'A' => [1, 2],+     *      'B' => [+     *          'C' => 1,+     *          'D' => 2,+     *      ],+     *      'E' => 1,+     *  ];+     * $result = \yii\helpers\ArrayHelper::flatten($array);+     * // $result will be:+     * // [+     * //     'A.0' => 1+     * //     'A.1' => 2+     * //     'B.C' => 1+     * //     'B.D' => 2+     * //     'E' => 1+     * // ]+     * ```+     *+     * @param array $array the input array to be flattened in terms of name-value pairs.+     * @param string $separator the separator to use between keys. Defaults to '.'.+     *+     * @return array the flattened array.+     * @throws InvalidArgumentException if `$array` is neither traversable nor an array.+     */+    public static function flatten($array, $separator = '.'): array+    {+        if (!static::isTraversable($array)) {+            throw new InvalidArgumentException('Argument $array must be an array or implement Traversable');+        }++        $result = [];++        foreach ($array as $key => $value) {+            $newKey = $key;+            if (is_array($value)) {+                $flattenedArray = self::flatten($value, $separator);+                foreach ($flattenedArray as $subKey => $subValue) {+                    $result[$newKey . $separator . $subKey] = $subValue;+                }+            } else {+                $result[$newKey] = $value;+            }+        }++        return $result;+    } }
AI Analysis
Vulnerability Existed: not sure  
CWE-838 - Inappropriate Encoding for Output Context - BaseArrayHelper.php [1040-1043]  
[Old Code]  
```php  
// No previous code existed for the flatten function  
```  
[Fixed Code]  
```php  
public static function flatten($array, $separator = '.'): array  
{  
    if (!static::isTraversable($array)) {  
        throw new InvalidArgumentException('Argument $array must be an array or implement Traversable');  
    }  

    $result = [];  

    foreach ($array as $key => $value) {  
        $newKey = $key;  
        if (is_array($value)) {  
            $flattenedArray = self::flatten($value, $separator);  
            foreach ($flattenedArray as $subKey => $subValue) {  
                $result[$newKey . $separator . $subKey] = $subValue;  
            }  
        } else {  
            $result[$newKey] = $value;  
        }  
    }  

    return $result;  
}  
```  

Vulnerability Existed: not sure  
CWE-838 - Inappropriate Encoding for Output Context - BaseArrayHelper.php [595-598]  
[Old Code]  
```php  
public static function map($array, $from, $to, $group = null)  
{  
    $result = [];  
    foreach ($array as $element) {  
        $key = static::getValue($element, $from);  
```  
[Fixed Code]  
```php  
public static function map($array, $from, $to, $group = null)  
{  
    if (is_string($from) && is_string($to) && $group === null && strpos($from, '.') === false && strpos($to, '.') === false) {  
        return array_column($array, $to, $from);  
    }  
    $result = [];  
    foreach ($array as $element) {  
        $key = static::getValue($element, $from);  
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/helpers/BaseStringHelper.php AI: No vulnerabilities
--- cache/yii2_2.0.51/framework/helpers/BaseStringHelper.php	2025-10-29 14:10:01.433480954 +0000+++ cache/yii2_2.0.52/framework/helpers/BaseStringHelper.php	2025-10-29 14:10:04.010644465 +0000@@ -313,9 +313,14 @@         }         if ($skipEmpty) {             // Wrapped with array_values to make array keys sequential after empty values removing-            $result = array_values(array_filter($result, function ($value) {-                return $value !== '';-            }));+            $result = array_values(+                array_filter(+                    $result,+                    function ($value) {+                        return $value !== '';+                    }+                )+            );         }          return $result;@@ -343,7 +348,7 @@      */     public static function normalizeNumber($value)     {-        $value = (string) $value;+        $value = (string)$value;          $localeInfo = localeconv();         $decimalSeparator = isset($localeInfo['decimal_point']) ? $localeInfo['decimal_point'] : null;@@ -396,7 +401,7 @@     {         // . and , are the only decimal separators known in ICU data,         // so its safe to call str_replace here-        return str_replace(',', '.', (string) $number);+        return str_replace(',', '.', (string)$number);     }      /**@@ -422,14 +427,14 @@          $replacements = [             '\\\\\\\\' => '\\\\',-            '\\\\\\*' => '[*]',-            '\\\\\\?' => '[?]',-            '\*' => '.*',-            '\?' => '.',-            '\[\!' => '[^',-            '\[' => '[',-            '\]' => ']',-            '\-' => '-',+            '\\\\\\*'  => '[*]',+            '\\\\\\?'  => '[?]',+            '\*'       => '.*',+            '\?'       => '.',+            '\[\!'     => '[^',+            '\['       => '[',+            '\]'       => ']',+            '\-'       => '-',         ];          if (isset($options['escape']) && !$options['escape']) {@@ -483,7 +488,7 @@      */     public static function mb_ucwords($string, $encoding = 'UTF-8')     {-        $string = (string) $string;+        $string = (string)$string;         if (empty($string)) {             return $string;         }
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - BaseStringHelper.php Lines 313-321
Old Code:
            $result = array_values(array_filter($result, function ($value) {
                return $value !== '';
            }));
Fixed Code:
            $result = array_values(
                array_filter(
                    $result,
                    function ($value) {
                        return $value !== '';
                    }
                )
            );

Vulnerability Existed: no
No specific vulnerability - N/A - BaseStringHelper.php Lines 343, 396, 488
Old Code:
        $value = (string) $value;
        return str_replace(',', '.', (string) $number);
        $string = (string) $string;
Fixed Code:
        $value = (string)$value;
        return str_replace(',', '.', (string)$number);
        $string = (string)$string;

Vulnerability Existed: no
No specific vulnerability - N/A - BaseStringHelper.php Lines 422-437
Old Code:
        $replacements = [
            '\\\\\\\\' => '\\\\',
            '\\\\\\*' => '[*]',
            '\\\\\\?' => '[?]',
            '\*' => '.*',
            '\?' => '.',
            '\[\!' => '[^',
            '\[' => '[',
            '\]' => ']',
            '\-' => '-',
        ];
Fixed Code:
        $replacements = [
            '\\\\\\\\' => '\\\\',
            '\\\\\\*'  => '[*]',
            '\\\\\\?'  => '[?]',
            '\*'       => '.*',
            '\?'       => '.',
            '\[\!'     => '[^',
            '\['       => '[',
            '\]'       => ']',
            '\-'       => '-',
        ];
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/helpers/array.meta-storm.xml AI: No vulnerabilities
--- /dev/null+++ cache/yii2_2.0.52/framework/helpers/array.meta-storm.xml@@ -0,0 +1,20 @@+<?xml version="1.0"?>+<meta-storm xmlns="meta-storm">+    <definitions>+        <classMethod class="\yii\helpers\BaseArrayHelper" method="getValue" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseArrayHelper" method="index" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseArrayHelper" method="getColumn" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseArrayHelper" method="map" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseArrayHelper" method="map" argument="2">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+    </definitions>+</meta-storm>
AI Analysis
Based on the provided code diff, I cannot identify any security vulnerabilities in the traditional sense. The diff shows the addition of a Meta-Storm XML configuration file that appears to define relationships between method arguments, but this is metadata for static analysis rather than functional code changes.

Here is my analysis following the required format:

```
Vulnerability Existed: no
No vulnerability identified - N/A - framework/helpers/array.meta-storm.xml 1-20
[Old Code]
File did not exist previously
[Fixed Code]
<?xml version="1.0"?>
<meta-storm xmlns="meta-storm">
    <definitions>
        <classMethod class="\yii\helpers\BaseArrayHelper" method="getValue" argument="1">
            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>
        </classMethod>
        <classMethod class="\yii\helpers\BaseArrayHelper" method="index" argument="1">
            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>
        </classMethod>
        <classMethod class="\yii\helpers\BaseArrayHelper" method="getColumn" argument="1">
            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>
        </classMethod>
        <classMethod class="\yii\helpers\BaseArrayHelper" method="map" argument="1">
            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>
        </classMethod>
        <classMethod class="\yii\helpers\BaseArrayHelper" method="map" argument="2">
            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>
        </classMethod>
    </definitions>
</meta-storm>
```

This diff represents the addition of static analysis configuration metadata (Meta-Storm) that defines relationships between method arguments in the BaseArrayHelper class. It does not contain any functional code changes that would introduce or fix security vulnerabilities. The file appears to be providing type relationship information for development tools rather than modifying application behavior.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/helpers/html.meta-storm.xml AI: Not Sure
--- /dev/null+++ cache/yii2_2.0.52/framework/helpers/html.meta-storm.xml@@ -0,0 +1,188 @@+<?xml version="1.0"?>+<meta-storm xmlns="meta-storm">+    <definitions>+        <classMethod class="\yii\helpers\BaseHtml" method="tag" argument="0">+            <collection name="yiisoft/yii2:html-tags"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="beginTag" argument="0">+            <collection name="yiisoft/yii2:html-tags"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="endTag" argument="0">+            <collection name="yiisoft/yii2:html-tags"/>+        </classMethod>++        <classMethod class="\yii\helpers\BaseHtml" method="activeLabel" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeHint" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="error" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeInput" argument="2">+            <properties protected="false" private="false" relatedArgument="1" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeTextInput" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="setActivePlaceholder" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeHiddenInput" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activePasswordInput" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeFileInput" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeTextarea" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeCheckbox" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeBooleanInput" argument="2">+            <properties protected="false" private="false" relatedArgument="1" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeDropDownList" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeListBox" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeCheckboxList" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="activeRadioList" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="getAttributeValue" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="getInputName" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\helpers\BaseHtml" method="getInputId" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+    </definitions>+    <collections>+        <strings name="yiisoft/yii2:html-tags">+            <value>div</value>+            <value>a</value>+            <value>abbr</value>+            <value>address</value>+            <value>area</value>+            <value>article</value>+            <value>aside</value>+            <value>audio</value>+            <value>b</value>+            <value>base</value>+            <value>bdi</value>+            <value>bdo</value>+            <value>blockquote</value>+            <value>body</value>+            <value>br</value>+            <value>button</value>+            <value>canvas</value>+            <value>caption</value>+            <value>cite</value>+            <value>code</value>+            <value>col</value>+            <value>colgroup</value>+            <value>data</value>+            <value>datalist</value>+            <value>dd</value>+            <value>del</value>+            <value>details</value>+            <value>dfn</value>+            <value>dialog</value>+            <value>div</value>+            <value>dl</value>+            <value>dt</value>+            <value>em</value>+            <value>embed</value>+            <value>fieldset</value>+            <value>figcaption</value>+            <value>figure</value>+            <value>footer</value>+            <value>form</value>+            <value>h1</value>+            <value>h2</value>+            <value>h3</value>+            <value>h4</value>+            <value>h5</value>+            <value>h6</value>+            <value>head</value>+            <value>header</value>+            <value>hgroup</value>+            <value>hr</value>+            <value>html</value>+            <value>i</value>+            <value>iframe</value>+            <value>img</value>+            <value>input</value>+            <value>ins</value>+            <value>kbd</value>+            <value>label</value>+            <value>legend</value>+            <value>li</value>+            <value>link</value>+            <value>main</value>+            <value>map</value>+            <value>mark</value>+            <value>meta</value>+            <value>meter</value>+            <value>nav</value>+            <value>noscript</value>+            <value>object</value>+            <value>ol</value>+            <value>optgroup</value>+            <value>option</value>+            <value>output</value>+            <value>p</value>+            <value>param</value>+            <value>picture</value>+            <value>pre</value>+            <value>progress</value>+            <value>q</value>+            <value>rp</value>+            <value>rt</value>+            <value>ruby</value>+            <value>s</value>+            <value>samp</value>+            <value>script</value>+            <value>section</value>+            <value>select</value>+            <value>small</value>+            <value>source</value>+            <value>span</value>+            <value>strong</value>+            <value>style</value>+            <value>sub</value>+            <value>summary</value>+            <value>sup</value>+            <value>svg</value>+            <value>table</value>+            <value>tbody</value>+            <value>td</value>+            <value>template</value>+            <value>textarea</value>+            <value>tfoot</value>+            <value>th</value>+            <value>thead</value>+            <value>time</value>+            <value>title</value>+            <value>tr</value>+            <value>track</value>+            <value>u</value>+            <value>ul</value>+            <value>var</value>+            <value>video</value>+            <value>wbr</value>+        </strings>+    </collections>+</meta-storm>
AI Analysis
Based on my analysis of the provided code diff, I can identify the following:

    Vulnerability Existed: not sure
    Input Validation - CWE-20 - framework/helpers/html.meta-storm.xml (entire file)
    [Old Code]
    File did not exist previously
    [Fixed Code]
    Added XML configuration file defining allowed HTML tags and form input types

This appears to be a security enhancement that adds input validation rules for HTML helper methods in the Yii2 framework. The meta-storm.xml file defines:

1. A whitelist of allowed HTML tags for methods like `tag()`, `beginTag()`, and `endTag()`
2. Input validation rules for various form input methods (`activeTextInput`, `activePasswordInput`, etc.)
3. Property validation for model attributes used in form helpers

The security improvement prevents potential XSS attacks by restricting which HTML tags can be generated and validating form input types, but since this is adding new validation rather than fixing existing vulnerable code, I cannot definitively say a vulnerability existed without seeing the actual code changes in the HTML helper methods themselves.

Note: This appears to be a static analysis configuration file (likely for a tool like Psalm or PHPStan) rather than runtime code, so the actual security impact depends on how this configuration is used by the analysis tool.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/helpers/mimeExtensions.php AI: Not Sure
--- cache/yii2_2.0.51/framework/helpers/mimeExtensions.php	2025-10-29 14:10:01.434481018 +0000+++ cache/yii2_2.0.52/framework/helpers/mimeExtensions.php	2025-10-29 14:10:04.010644465 +0000@@ -961,6 +961,7 @@         'pjp',         'pjpeg',     ],+    'image/jxl' => 'jxl',     'image/ktx' => 'ktx',     'image/png' => 'png',     'image/prs.btif' => 'btif',
AI Analysis
Vulnerability Existed: not sure  
CWE-Unknown - Unknown - framework/helpers/mimeExtensions.php [Lines 961-961]  
Old Code:  
```php
        'pjp',
        'pjpeg',
    ],
    'image/ktx' => 'ktx',
```  
Fixed Code:  
```php
        'pjp',
        'pjpeg',
    ],
    'image/jxl' => 'jxl',
    'image/ktx' => 'ktx',
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/helpers/mimeTypes.php AI: No vulnerabilities
--- cache/yii2_2.0.51/framework/helpers/mimeTypes.php	2025-10-29 14:10:01.434481018 +0000+++ cache/yii2_2.0.52/framework/helpers/mimeTypes.php	2025-10-29 14:10:04.010644465 +0000@@ -376,6 +376,7 @@     'js' => 'text/javascript',     'json' => 'application/json',     'jsonml' => 'application/jsonml+json',+    'jxl' => 'image/jxl',     'kar' => 'audio/midi',     'karbon' => 'application/vnd.kde.karbon',     'kfo' => 'application/vnd.kde.kformula',
AI Analysis
Vulnerability Existed: no
No specific CWE - N/A - framework/helpers/mimeTypes.php Lines 376+
[Old Code]
    'jsonml' => 'application/jsonml+json',
    'kar' => 'audio/midi',
[Fixed Code]
    'jsonml' => 'application/jsonml+json',
    'jxl' => 'image/jxl',
    'kar' => 'audio/midi',

This diff shows only the addition of a new MIME type mapping for 'jxl' (JPEG XL image format) to 'image/jxl'. This is a routine update to support a new file format and does not represent a security vulnerability fix. The change simply expands the MIME type database without modifying any security-related functionality.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/log/FileTarget.php AI: 1 vulnerabilities
--- cache/yii2_2.0.51/framework/log/FileTarget.php	2025-10-29 14:10:01.434481018 +0000+++ cache/yii2_2.0.52/framework/log/FileTarget.php	2025-10-29 14:10:04.011644528 +0000@@ -131,8 +131,11 @@         }         $writeResult = @fwrite($fp, $text);         if ($writeResult === false) {-            $error = error_get_last();-            throw new LogRuntimeException("Unable to export log through file ({$this->logFile})!: {$error['message']}");+            $message = "Unable to export log through file ($this->logFile)!";+            if ($error = error_get_last()) {+                $message .= ": {$error['message']}";+            }+            throw new LogRuntimeException($message);         }         $textSize = strlen($text);         if ($writeResult < $textSize) {
AI Analysis
Vulnerability Existed: yes
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CWE-200 - FileTarget.php 134-138
[Old Code]
        $writeResult = @fwrite($fp, $text);
        if ($writeResult === false) {
            $error = error_get_last();
            throw new LogRuntimeException("Unable to export log through file ({$this->logFile})!: {$error['message']}");
        }
[Fixed Code]
        $writeResult = @fwrite($fp, $text);
        if ($writeResult === false) {
            $message = "Unable to export log through file ($this->logFile)!";
            if ($error = error_get_last()) {
                $message .= ": {$error['message']}";
            }
            throw new LogRuntimeException($message);
        }

Vulnerability Existed: not sure
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CWE-200 - FileTarget.php 131-140
[Old Code]
        }
        $writeResult = @fwrite($fp, $text);
        if ($writeResult === false) {
            $error = error_get_last();
            throw new LogRuntimeException("Unable to export log through file ({$this->logFile})!: {$error['message']}");
        }
        $textSize = strlen($text);
        if ($writeResult < $textSize) {
[Fixed Code]
        }
        $writeResult = @fwrite($fp, $text);
        if ($writeResult === false) {
            $message = "Unable to export log through file ($this->logFile)!";
            if ($error = error_get_last()) {
                $message .= ": {$error['message']}";
            }
            throw new LogRuntimeException($message);
        }
        $textSize = strlen($text);
        if ($writeResult < $textSize) {
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/log/Target.php AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/log/Target.php	2025-10-29 14:10:01.435481081 +0000+++ cache/yii2_2.0.52/framework/log/Target.php	2025-10-29 14:10:04.011644528 +0000@@ -11,6 +11,7 @@ use yii\base\Component; use yii\base\InvalidConfigException; use yii\helpers\ArrayHelper;+use yii\helpers\StringHelper; use yii\helpers\VarDumper; use yii\web\Request; @@ -91,6 +92,11 @@      * - `var` - `var` will be logged as `***`      * - `var.key` - only `var[key]` will be logged as `***`      *+     * In addition, this property accepts (case-insensitive) patterns. For example:+     * - `_SERVER.*_SECRET` matches all ending with `_SECRET`, such as `$_SERVER['TOKEN_SECRET']` etc.+     * - `_SERVER.SECRET_*` matches all starting with `SECRET_`, such as `$_SERVER['SECRET_TOKEN']` etc.+     * - `_SERVER.*SECRET*` matches all containing `SECRET` i.e. both of the above.+     *      * @since 2.0.16      */     public $maskVars = [@@ -169,9 +175,12 @@     protected function getContextMessage()     {         $context = ArrayHelper::filter($GLOBALS, $this->logVars);+        $items = ArrayHelper::flatten($context);         foreach ($this->maskVars as $var) {-            if (ArrayHelper::getValue($context, $var) !== null) {-                ArrayHelper::setValue($context, $var, '***');+            foreach ($items as $key => $value) {+                if (StringHelper::matchWildcard($var, $key, ['caseSensitive' => false])) {+                    ArrayHelper::setValue($context, $key, '***');+                }             }         }         $result = [];@@ -292,7 +301,7 @@      */     public function formatMessage($message)     {-        list($text, $level, $category, $timestamp) = $message;+        [$text, $level, $category, $timestamp] = $message;         $level = Logger::getLevelName($level);         if (!is_string($text)) {             // exceptions may not be serializable if in the call stack somewhere is a Closure
AI Analysis
Vulnerability Existed: yes
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CWE-200 - Target.php [Lines 169-182]
Old Code:
    protected function getContextMessage()
    {
        $context = ArrayHelper::filter($GLOBALS, $this->logVars);
        foreach ($this->maskVars as $var) {
            if (ArrayHelper::getValue($context, $var) !== null) {
                ArrayHelper::setValue($context, $var, '***');
            }
        }
        $result = [];
Fixed Code:
    protected function getContextMessage()
    {
        $context = ArrayHelper::filter($GLOBALS, $this->logVars);
        $items = ArrayHelper::flatten($context);
        foreach ($this->maskVars as $var) {
            foreach ($items as $key => $value) {
                if (StringHelper::matchWildcard($var, $key, ['caseSensitive' => false])) {
                    ArrayHelper::setValue($context, $key, '***');
                }
            }
        }
        $result = [];

Vulnerability Existed: yes
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CWE-200 - Target.php [Lines 91-98]
Old Code:
     * - `var` - `var` will be logged as `***`
     * - `var.key` - only `var[key]` will be logged as `***`
     *
     * @since 2.0.16
     */
    public $maskVars = [
Fixed Code:
     * - `var` - `var` will be logged as `***`
     * - `var.key` - only `var[key]` will be logged as `***`
     *
     * In addition, this property accepts (case-insensitive) patterns. For example:
     * - `_SERVER.*_SECRET` matches all ending with `_SECRET`, such as `$_SERVER['TOKEN_SECRET']` etc.
     * - `_SERVER.SECRET_*` matches all starting with `SECRET_`, such as `$_SERVER['SECRET_TOKEN']` etc.
     * - `_SERVER.*SECRET*` matches all containing `SECRET` i.e. both of the above.
     *
     * @since 2.0.16
     */
    public $maskVars = [
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/messages/bs/yii.php AI: No vulnerabilities
--- cache/yii2_2.0.51/framework/messages/bs/yii.php	2025-10-29 14:10:01.435481081 +0000+++ cache/yii2_2.0.52/framework/messages/bs/yii.php	2025-10-29 14:10:04.013644655 +0000@@ -120,7 +120,7 @@     '{delta, plural, =1{a day} other{# days}} ago' => 'prije {delta, plural, =1{dan} one{# dan} few{# dana} many{# dana} other{# dana}}',     '{delta, plural, =1{a minute} other{# minutes}} ago' => 'prije {delta, plural, =1{minut} one{# minut} few{# minuta} many{# minuta} other{# minuta}}',     '{delta, plural, =1{a month} other{# months}} ago' => 'prije {delta, plural, =1{mjesec} one{# mjesec} few{# mjeseci} many{# mjeseci} other{# mjeseci}}',-    '{delta, plural, =1{a second} other{# seconds}} ago' => 'prije {delta, plural, =1{sekundu} one{# sekundu} few{# sekundi} many{# sekundi} other{# sekundi}',+    '{delta, plural, =1{a second} other{# seconds}} ago' => 'prije {delta, plural, =1{sekundu} one{# sekundu} few{# sekundi} many{# sekundi} other{# sekundi}}',     '{delta, plural, =1{a year} other{# years}} ago' => 'prije {delta, plural, =1{godinu} one{# godinu} few{# godina} many{# godina} other{# godina}}',     '{delta, plural, =1{an hour} other{# hours}} ago' => 'prije {delta, plural, =1{sat} one{# sat} few{# sati} many{# sati} other{# sati}}',     '{nFormatted} B' => '{nFormatted} B',
AI Analysis
Vulnerability Existed: no  
No specific CWE - N/A - framework/messages/bs/yii.php Line 123  
Old Code: `'{delta, plural, =1{a second} other{# seconds}} ago' => 'prije {delta, plural, =1{sekundu} one{# sekundu} few{# sekundi} many{# sekundi} other{# sekundi}',`  
Fixed Code: `'{delta, plural, =1{a second} other{# seconds}} ago' => 'prije {delta, plural, =1{sekundu} one{# sekundu} few{# sekundi} many{# sekundi} other{# sekundi}}',`

**Analysis:**  
This diff shows a simple syntax fix in a Bosnian language translation file. The change corrects a missing closing brace `}` in a pluralization message format. This is a localization fix rather than a security vulnerability. The correction ensures proper pluralization formatting in the Bosnian language, preventing potential display issues or formatting errors in time-related messages. No security vulnerability is addressed by this change.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/messages/zh-TW/yii.php AI: No vulnerabilities
--- cache/yii2_2.0.51/framework/messages/zh-TW/yii.php	2025-10-29 14:10:01.439481335 +0000+++ cache/yii2_2.0.52/framework/messages/zh-TW/yii.php	2025-10-29 14:10:04.016644846 +0000@@ -24,7 +24,7 @@  * NOTE: this file must be saved in UTF-8 encoding.  */ return [-    ' and ' => '',+    ' and ' => ' 與 ',     '"{attribute}" does not support operator "{operator}".' => '',     '(not set)' => '(未設定)',     'Action not found.' => '',@@ -51,7 +51,7 @@     'Please fix the following errors:' => '請修正以下錯誤:',     'Please upload a file.' => '請上傳一個檔案。',     'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.' => '第 <b>{begin, number}-{end, number}</b> 項,共 <b>{totalCount, number}</b> 項資料.',-    'The combination {values} of {attributes} has already been taken.' => '',+    'The combination {values} of {attributes} has already been taken.' => '{attribute} 的值 "{value}" 已經被佔用了。',     'The file "{file}" is not an image.' => '檔案 "{file}" 不是一個圖片檔案。',     'The file "{file}" is too big. Its size cannot exceed {formattedLimit}.' => '檔案"{file}"太大了。它的大小不可以超過{formattedLimit}。',     'The file "{file}" is too small. Its size cannot be smaller than {formattedLimit}.' => '文件"{file}"太小了。它的大小不可以小於{formattedLimit}。',
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - framework/messages/zh-TW/yii.php Lines 24, 51
Old Code: 
    ' and ' => '',
    'The combination {values} of {attributes} has already been taken.' => '',
Fixed Code:
    ' and ' => ' 與 ',
    'The combination {values} of {attributes} has already been taken.' => '{attribute} 的值 "{value}" 已經被佔用了。'

Explanation: This diff shows only localization updates for Traditional Chinese (zh-TW) language translations. The changes involve adding proper Chinese translations for English phrases. There are no security vulnerabilities being fixed here - these are purely linguistic improvements to make the framework more accessible to Traditional Chinese speakers. The changes don't affect any security-related functionality, input validation, or output encoding mechanisms.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/validators/FileValidator.php AI: 1 vulnerabilities
--- cache/yii2_2.0.51/framework/validators/FileValidator.php	2025-10-29 14:10:01.441481462 +0000+++ cache/yii2_2.0.52/framework/validators/FileValidator.php	2025-10-29 14:10:04.018644973 +0000@@ -209,7 +209,7 @@     {         $files = $this->filterFiles(is_array($model->$attribute) ? $model->$attribute : [$model->$attribute]);         $filesCount = count($files);-        if ($filesCount === 0 && $this->minFiles > 0) {+        if ($filesCount === 0) {             $this->addError($model, $attribute, $this->uploadRequired);              return;
AI Analysis
Vulnerability Existed: yes
CWE-434: Unrestricted Upload of File with Dangerous Type - CWE-434 - FileValidator.php [Lines 209-213]
Old Code:
        $files = $this->filterFiles(is_array($model->$attribute) ? $model->$attribute : [$model->$attribute]);
        $filesCount = count($files);
        if ($filesCount === 0 && $this->minFiles > 0) {
            $this->addError($model, $attribute, $this->uploadRequired);

            return;
Fixed Code:
        $files = $this->filterFiles(is_array($model->$attribute) ? $model->$attribute : [$model->$attribute]);
        $filesCount = count($files);
        if ($filesCount === 0) {
            $this->addError($model, $attribute, $this->uploadRequired);

            return;
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/views/migration.php AI: Not Sure
--- cache/yii2_2.0.51/framework/views/migration.php	2025-10-29 14:10:01.442481525 +0000+++ cache/yii2_2.0.52/framework/views/migration.php	2025-10-29 14:10:04.019645036 +0000@@ -17,9 +17,6 @@  use yii\db\Migration; -/**- * Class <?= $className . "\n" ?>- */ class <?= $className ?> extends Migration {     /**
AI Analysis
Vulnerability Existed: not sure  
CWE-200 - Information Exposure - framework/views/migration.php 17-20  
Old Code:  
```php
/**
 * Class <?= $className . "\n" ?>
 */
```  
Fixed Code:  
```php
```  

Note: The change removes a comment that potentially exposes the class name through generated migration files. While this doesn't appear to be a direct security vulnerability, it could be considered a minor information disclosure issue if the generated class names reveal sensitive information about the application structure.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/web/CacheSession.php AI: Not Sure
--- cache/yii2_2.0.51/framework/web/CacheSession.php	2025-10-29 14:10:01.442481525 +0000+++ cache/yii2_2.0.52/framework/web/CacheSession.php	2025-10-29 14:10:04.019645036 +0000@@ -92,7 +92,7 @@      * Session read handler.      * @internal Do not call this method directly.      * @param string $id session ID-     * @return string the session data+     * @return string|false the session data, or false on failure      */     public function readSession($id)     {
AI Analysis
Vulnerability Existed: not sure  
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CacheSession.php [Lines: 92]  
[Old Code]  
    public function readSession($id)  
[Fixed Code]  
    public function readSession($id)
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/web/DbSession.php AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/web/DbSession.php	2025-10-29 14:10:01.442481525 +0000+++ cache/yii2_2.0.52/framework/web/DbSession.php	2025-10-29 14:10:04.020645099 +0000@@ -171,7 +171,7 @@      * Session read handler.      * @internal Do not call this method directly.      * @param string $id session ID-     * @return string the session data+     * @return string|false the session data, or false on failure      */     public function readSession($id)     {@@ -247,15 +247,13 @@      * Session GC (garbage collection) handler.      * @internal Do not call this method directly.      * @param int $maxLifetime the number of seconds after which data will be seen as 'garbage' and cleaned up.-     * @return bool whether session is GCed successfully+     * @return int|false the number of deleted sessions on success, or false on failure      */     public function gcSession($maxLifetime)     {-        $this->db->createCommand()+        return $this->db->createCommand()             ->delete($this->sessionTable, '[[expire]]<:expire', [':expire' => time()])             ->execute();--        return true;     }      /**
AI Analysis
Vulnerability Existed: yes  
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CWE-200 - DbSession.php [171, 247]  
Old Code:  
```php
    public function readSession($id)
    {
        // ... implementation ...
    }
    
    public function gcSession($maxLifetime)
    {
        $this->db->createCommand()
            ->delete($this->sessionTable, '[[expire]]<:expire', [':expire' => time()])
            ->execute();

        return true;
    }
```  
Fixed Code:  
```php
    public function readSession($id)
    {
        // ... implementation ...
    }
    
    public function gcSession($maxLifetime)
    {
        return $this->db->createCommand()
            ->delete($this->sessionTable, '[[expire]]<:expire', [':expire' => time()])
            ->execute();
    }
```  

Vulnerability Existed: yes  
CWE-209: Generation of Error Message Containing Sensitive Information - CWE-209 - DbSession.php [171, 247]  
Old Code:  
```php
    public function readSession($id)
    {
        // ... implementation ...
    }
    
    public function gcSession($maxLifetime)
    {
        $this->db->createCommand()
            ->delete($this->sessionTable, '[[expire]]<:expire', [':expire' => time()])
            ->execute();

        return true;
    }
```  
Fixed Code:  
```php
    public function readSession($id)
    {
        // ... implementation ...
    }
    
    public function gcSession($maxLifetime)
    {
        return $this->db->createCommand()
            ->delete($this->sessionTable, '[[expire]]<:expire', [':expire' => time()])
            ->execute();
    }
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/web/Request.php AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/web/Request.php	2025-10-29 14:10:01.443481589 +0000+++ cache/yii2_2.0.52/framework/web/Request.php	2025-10-29 14:10:04.020645099 +0000@@ -41,8 +41,9 @@  * @property-read string $contentType Request content-type. Empty string is returned if this information is  * not available.  * @property-read CookieCollection $cookies The cookie collection.- * @property-read string $csrfToken The token used to perform CSRF validation.- * @property-read string|null $csrfTokenFromHeader The CSRF token sent via [[CSRF_HEADER]] by browser. Null is+ * @property-read null|string $csrfToken The token used to perform CSRF validation. Null is returned if the+ * [[validateCsrfHeaderOnly]] is true.+ * @property-read string|null $csrfTokenFromHeader The CSRF token sent via [[csrfHeader]] by browser. Null is  * returned if no such header is sent.  * @property-read array $eTags The entity tags.  * @property-read HeaderCollection $headers The header collection.@@ -91,7 +92,7 @@ class Request extends \yii\base\Request {     /**-     * The name of the HTTP header for sending CSRF token.+     * Default name of the HTTP header for sending CSRF token.      */     const CSRF_HEADER = 'X-CSRF-Token';     /**@@ -113,11 +114,42 @@      * `yii.getCsrfToken()`, respectively. The [[\yii\web\YiiAsset]] asset must be registered.      * You also need to include CSRF meta tags in your pages by using [[\yii\helpers\Html::csrfMetaTags()]].      *+     * For SPA, you can use CSRF validation by custom header with a random or an empty value.+     * Include a header with the name specified by [[csrfHeader]] to requests that must be validated.+     * Warning! CSRF validation by custom header can be used only for same-origin requests or+     * with CORS configured to allow requests from the list of specific origins only.+     *      * @see Controller::enableCsrfValidation      * @see https://en.wikipedia.org/wiki/Cross-site_request_forgery      */     public $enableCsrfValidation = true;     /**+     * @var string the name of the HTTP header for sending CSRF token. Defaults to [[CSRF_HEADER]].+     * This property may be changed for Yii API applications only.+     * Don't change this property for Yii Web application.+     */+    public $csrfHeader = self::CSRF_HEADER;+    /**+     * @var array the name of the HTTP header for sending CSRF token.+     * by default validate CSRF token on non-"safe" methods only+     * This property is used only when [[enableCsrfValidation]] is true.+     * @see https://datatracker.ietf.org/doc/html/rfc9110#name-safe-methods+     */+    public $csrfTokenSafeMethods = ['GET', 'HEAD', 'OPTIONS'];+    /**+     * @var array "unsafe" methods not triggered a CORS-preflight request+     * This property is used only when both [[enableCsrfValidation]] and [[validateCsrfHeaderOnly]] are true.+     * @see https://fetch.spec.whatwg.org/#http-cors-protocol+     */+    public $csrfHeaderUnsafeMethods = ['GET', 'HEAD', 'POST'];+    /**+     * @var bool whether to use custom header only to CSRF validation of SPA. Defaults to false.+     * If false and [[enableCsrfValidation]] is true, CSRF validation by token will used.+     * Warning! CSRF validation by custom header can be used for Yii API applications only.+     * @see https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#employing-custom-request-headers-for-ajaxapi+     */+    public $validateCsrfHeaderOnly = false;+    /**      * @var string the name of the token used to prevent CSRF. Defaults to '_csrf'.      * This property is used only when [[enableCsrfValidation]] is true.      */@@ -1772,10 +1804,14 @@      * along via a hidden field of an HTML form or an HTTP header value to support CSRF validation.      * @param bool $regenerate whether to regenerate CSRF token. When this parameter is true, each time      * this method is called, a new CSRF token will be generated and persisted (in session or cookie).-     * @return string the token used to perform CSRF validation.+     * @return null|string the token used to perform CSRF validation. Null is returned if the [[validateCsrfHeaderOnly]] is true.      */     public function getCsrfToken($regenerate = false)     {+        if ($this->validateCsrfHeaderOnly) {+            return null;+        }+         if ($this->_csrfToken === null || $regenerate) {             $token = $this->loadCsrfToken();             if ($regenerate || empty($token)) {@@ -1819,11 +1855,11 @@     }      /**-     * @return string|null the CSRF token sent via [[CSRF_HEADER]] by browser. Null is returned if no such header is sent.+     * @return string|null the CSRF token sent via [[csrfHeader]] by browser. Null is returned if no such header is sent.      */     public function getCsrfTokenFromHeader()     {-        return $this->headers->get(static::CSRF_HEADER);+        return $this->headers->get($this->csrfHeader);     }      /**@@ -1860,8 +1896,14 @@     public function validateCsrfToken($clientSuppliedToken = null)     {         $method = $this->getMethod();-        // only validate CSRF token on non-"safe" methods https://tools.ietf.org/html/rfc2616#section-9.1.1-        if (!$this->enableCsrfValidation || in_array($method, ['GET', 'HEAD', 'OPTIONS'], true)) {++        if ($this->validateCsrfHeaderOnly) {+            return in_array($method, $this->csrfHeaderUnsafeMethods, true)+                ? $this->headers->has($this->csrfHeader)+                : true;+        }++        if (!$this->enableCsrfValidation || in_array($method, $this->csrfTokenSafeMethods, true)) {             return true;         } 
AI Analysis
Vulnerability Existed: yes  
CWE-352 Cross-Site Request Forgery (CSRF) - CWE-352 - File: framework/web/Request.php Lines: 1860-1870  
[Old Code]  
```php
        $method = $this->getMethod();
        // only validate CSRF token on non-"safe" methods https://tools.ietf.org/html/rfc2616#section-9.1.1
        if (!$this->enableCsrfValidation || in_array($method, ['GET', 'HEAD', 'OPTIONS'], true)) {
            return true;
        }
```  
[Fixed Code]  
```php
        $method = $this->getMethod();

        if ($this->validateCsrfHeaderOnly) {
            return in_array($method, $this->csrfHeaderUnsafeMethods, true)
                ? $this->headers->has($this->csrfHeader)
                : true;
        }

        if (!$this->enableCsrfValidation || in_array($method, $this->csrfTokenSafeMethods, true)) {
            return true;
        }
```

Vulnerability Existed: yes  
CWE-352 Cross-Site Request Forgery (CSRF) - CWE-352 - File: framework/web/Request.php Lines: 1772-1785  
[Old Code]  
```php
    public function getCsrfToken($regenerate = false)
    {
        if ($this->_csrfToken === null || $regenerate) {
            $token = $this->loadCsrfToken();
            if ($regenerate || empty($token)) {
                $token = $this->generateCsrfToken();
            }
            $this->_csrfToken = Yii::$app->security->maskToken($token);
        }

        return $this->_csrfToken;
    }
```  
[Fixed Code]  
```php
    public function getCsrfToken($regenerate = false)
    {
        if ($this->validateCsrfHeaderOnly) {
            return null;
        }

        if ($this->_csrfToken === null || $regenerate) {
            $token = $this->loadCsrfToken();
            if ($regenerate || empty($token)) {
                $token = $this->generateCsrfToken();
            }
            $this->_csrfToken = Yii::$app->security->maskToken($token);
        }

        return $this->_csrfToken;
    }
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/web/Session.php AI: 2 vulnerabilities
--- cache/yii2_2.0.51/framework/web/Session.php	2025-10-29 14:10:01.443481589 +0000+++ cache/yii2_2.0.52/framework/web/Session.php	2025-10-29 14:10:04.021645163 +0000@@ -145,7 +145,9 @@          $this->registerSessionHandler(); -        $this->setCookieParamsInternal();+        if ($this->getUseCookies() !== false) {+            $this->setCookieParamsInternal();+        }          YII_DEBUG ? session_start() : @session_start(); @@ -175,34 +177,23 @@             static::$_originalSessionModule = $sessionModuleName;         } +        if ($this->handler === null && $this->getUseCustomStorage()) {+            $this->handler = Yii::createObject(+                [+                    '__class' => SessionHandler::class,+                    '__construct()' => [$this],+                ]+            );+        }+         if ($this->handler !== null) {-            if (!is_object($this->handler)) {+            if (is_array($this->handler)) {                 $this->handler = Yii::createObject($this->handler);             }             if (!$this->handler instanceof \SessionHandlerInterface) {                 throw new InvalidConfigException('"' . get_class($this) . '::handler" must implement the SessionHandlerInterface.');             }             YII_DEBUG ? session_set_save_handler($this->handler, false) : @session_set_save_handler($this->handler, false);-        } elseif ($this->getUseCustomStorage()) {-            if (YII_DEBUG) {-                session_set_save_handler(-                    [$this, 'openSession'],-                    [$this, 'closeSession'],-                    [$this, 'readSession'],-                    [$this, 'writeSession'],-                    [$this, 'destroySession'],-                    [$this, 'gcSession']-                );-            } else {-                @session_set_save_handler(-                    [$this, 'openSession'],-                    [$this, 'closeSession'],-                    [$this, 'readSession'],-                    [$this, 'writeSession'],-                    [$this, 'destroySession'],-                    [$this, 'gcSession']-                );-            }         } elseif (             $sessionModuleName !== static::$_originalSessionModule             && static::$_originalSessionModule !== null@@ -610,7 +601,7 @@      * This method should be overridden if [[useCustomStorage]] returns true.      * @internal Do not call this method directly.      * @param string $id session ID-     * @return string the session data+     * @return string|false the session data, or false on failure      */     public function readSession($id)     {@@ -647,11 +638,11 @@      * This method should be overridden if [[useCustomStorage]] returns true.      * @internal Do not call this method directly.      * @param int $maxLifetime the number of seconds after which data will be seen as 'garbage' and cleaned up.-     * @return bool whether session is GCed successfully+     * @return int|false the number of deleted sessions on success, or false on failure      */     public function gcSession($maxLifetime)     {-        return true;+        return 0;     }      /**
AI Analysis
Vulnerability Existed: yes  
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - Session.php 145-147  
Old Code:  
```php
        $this->registerSessionHandler();

        $this->setCookieParamsInternal();

        YII_DEBUG ? session_start() : @session_start();
```  
Fixed Code:  
```php
        $this->registerSessionHandler();

        if ($this->getUseCookies() !== false) {
            $this->setCookieParamsInternal();
        }

        YII_DEBUG ? session_start() : @session_start();
```

Vulnerability Existed: yes  
CWE-459: Incomplete Cleanup - Session.php 647-649  
Old Code:  
```php
    public function gcSession($maxLifetime)
    {
        return true;
    }
```  
Fixed Code:  
```php
    public function gcSession($maxLifetime)
    {
        return 0;
    }
```

Vulnerability Existed: not sure  
CWE-665: Improper Initialization - Session.php 175-210  
Old Code:  
```php
        if ($this->handler !== null) {
            if (!is_object($this->handler)) {
                $this->handler = Yii::createObject($this->handler);
            }
            if (!$this->handler instanceof \SessionHandlerInterface) {
                throw new InvalidConfigException('"' . get_class($this) . '::handler" must implement the SessionHandlerInterface.');
            }
            YII_DEBUG ? session_set_save_handler($this->handler, false) : @session_set_save_handler($this->handler, false);
        } elseif ($this->getUseCustomStorage()) {
            if (YII_DEBUG) {
                session_set_save_handler(
                    [$this, 'openSession'],
                    [$this, 'closeSession'],
                    [$this, 'readSession'],
                    [$this, 'writeSession'],
                    [$this, 'destroySession'],
                    [$this, 'gcSession']
                );
            } else {
                @session_set_save_handler(
                    [$this, 'openSession'],
                    [$this, 'closeSession'],
                    [$this, 'readSession'],
                    [$this, 'writeSession'],
                    [$this, 'destroySession'],
                    [$this, 'gcSession']
                );
            }
        } elseif (
```  
Fixed Code:  
```php
        if ($this->handler === null && $this->getUseCustomStorage()) {
            $this->handler = Yii::createObject(
                [
                    '__class' => SessionHandler::class,
                    '__construct()' => [$this],
                ]
            );
        }

        if ($this->handler !== null) {
            if (is_array($this->handler)) {
                $this->handler = Yii::createObject($this->handler);
            }
            if (!$this->handler instanceof \SessionHandlerInterface) {
                throw new InvalidConfigException('"' . get_class($this) . '::handler" must implement the SessionHandlerInterface.');
            }
            YII_DEBUG ? session_set_save_handler($this->handler, false) : @session_set_save_handler($this->handler, false);
        } elseif (
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/web/SessionHandler.php AI: Not Sure
--- /dev/null+++ cache/yii2_2.0.52/framework/web/SessionHandler.php@@ -0,0 +1,80 @@+<?php+/**+ * @link https://www.yiiframework.com/+ * @copyright Copyright (c) 2008 Yii Software LLC+ * @license https://www.yiiframework.com/license/+ */++namespace yii\web;++use SessionHandlerInterface;++/**+ * SessionHandler implements an [[\SessionHandlerInterface]] for handling [[Session]] with custom session storage.+ *+ * @author Viktor Khokhryakov <[email protected]>+ * @since 2.0.52+ */+class SessionHandler implements SessionHandlerInterface+{+    /**+     * @var Session+     */+    private $_session;+++    public function __construct(Session $session)+    {+        $this->_session = $session;+    }++    /**+     * @inheritDoc+     */+    public function close(): bool+    {+        return $this->_session->closeSession();+    }++    /**+     * @inheritDoc+     */+    public function destroy($id): bool+    {+        return $this->_session->destroySession($id);+    }++    /**+     * @inheritDoc+     */+    #[\ReturnTypeWillChange]+    public function gc($max_lifetime)+    {+        return $this->_session->gcSession($max_lifetime);+    }++    /**+     * @inheritDoc+     */+    public function open($path, $name): bool+    {+        return $this->_session->openSession($path, $name);+    }++    /**+     * @inheritDoc+     */+    #[\ReturnTypeWillChange]+    public function read($id)+    {+        return $this->_session->readSession($id);+    }++    /**+     * @inheritDoc+     */+    public function write($id, $data): bool+    {+        return $this->_session->writeSession($id, $data);+    }+}
AI Analysis
Vulnerability Existed: not sure  
CWE-200: Information Exposure - CWE-200 - SessionHandler.php (entire file)  
[Old Code]  
N/A (new file)  
[Fixed Code]  
```php
class SessionHandler implements SessionHandlerInterface
{
    private $_session;

    public function __construct(Session $session)
    {
        $this->_session = $session;
    }

    // ... session handler interface methods ...
}
```

Vulnerability Existed: not sure  
CWE-384: Session Fixation - CWE-384 - CacheSession.php (lines in openSession function)  
[Old Code]  
```php
if ($this->getUseStrictMode()) {
    $id = $this->getId();
    if (!$this->cache->exists($this->calculateKey($id))) {
        //This session id does not exist, mark it for forced regeneration
        $this->_forceRegenerateId = $id;
    }
}
```  
[Fixed Code]  
The new SessionHandler class provides a standardized interface that may help enforce strict session management practices, potentially mitigating session fixation risks through proper session validation and regeneration.

Vulnerability Existed: not sure  
CWE-922: Insecure Storage of Sensitive Information - CWE-922 - CacheSession.php (lines in writeSession function)  
[Old Code]  
```php
return $this->cache->set($this->calculateKey($id), $data, $this->getTimeout());
```  
[Fixed Code]  
The new SessionHandler class provides a wrapper that could potentially add additional security layers for session data storage, though the actual storage mechanism remains in the underlying session implementation.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/web/view.meta-storm.xml AI: No vulnerabilities
--- /dev/null+++ cache/yii2_2.0.52/framework/web/view.meta-storm.xml@@ -0,0 +1,8 @@+<?xml version="1.0"?>+<meta-storm xmlns="meta-storm">+    <definitions>+        <classMethod class="\yii\web\View" method="render" argument="0">+            <files extension="php" xpath="$directory"/>+        </classMethod>+    </definitions>+</meta-storm>
AI Analysis
Based on the provided diff, I cannot identify any specific security vulnerability being fixed. The diff shows the addition of a new meta-storm configuration file rather than a code change that would fix a security issue.

Vulnerability Existed: no
N/A - N/A - framework/web/view.meta-storm.xml [1-8]
N/A
N/A

This appears to be adding metadata or configuration for the View::render method, likely for static analysis or development tooling purposes, rather than addressing a security vulnerability. The file defines that the render method's first argument (argument="0") relates to PHP files in a directory context, but this doesn't represent a security fix.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
framework/widgets/widgets.meta-storm.xml AI: No vulnerabilities
--- /dev/null+++ cache/yii2_2.0.52/framework/widgets/widgets.meta-storm.xml@@ -0,0 +1,11 @@+<?xml version="1.0"?>+<meta-storm xmlns="meta-storm">+    <definitions>+        <classMethod class="\yii\widgets\ActiveForm" method="field" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+        <classMethod class="\yii\widgets\ActiveForm" method="beginField" argument="1">+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>+        </classMethod>+    </definitions>+</meta-storm>
AI Analysis
Based on the provided code diff, I cannot identify any specific security vulnerabilities. Here is my analysis:

Vulnerability Existed: no
No specific vulnerability identified - N/A - framework/widgets/widgets.meta-storm.xml [1-11]
```xml
+<?xml version="1.0"?>
+<meta-storm xmlns="meta-storm">
+    <definitions>
+        <classMethod class="\yii\widgets\ActiveForm" method="field" argument="1">
+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>
+        </classMethod>
+        <classMethod class="\yii\widgets\ActiveForm" method="beginField" argument="1">
+            <properties protected="false" private="false" relatedArgument="0" relatedTo="argument"/>
+        </classMethod>
+    </definitions>
+</meta-storm>
```
```xml
N/A (This is a new file being added, no old code to compare)
```

Explanation:
This diff shows the addition of a new XML configuration file (`widgets.meta-storm.xml`) that appears to be metadata configuration for the Yii2 framework's ActiveForm widget methods. The file defines properties for method arguments, but doesn't contain any executable code or security-sensitive configurations that would indicate a specific vulnerability being fixed. This appears to be adding framework metadata rather than patching a security issue.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/data/config.php AI: 1 vulnerabilities
--- cache/yii2_2.0.51/tests/data/config.php	2025-10-29 14:10:01.447481843 +0000+++ cache/yii2_2.0.52/tests/data/config.php	2025-10-29 14:10:04.024645353 +0000@@ -37,7 +37,7 @@             'fixture' => __DIR__ . '/sqlite.sql',         ],         'sqlsrv' => [-            'dsn' => 'sqlsrv:Server=127.0.0.1,1433;Database=yiitest',+            'dsn' => 'sqlsrv:Server=127.0.0.1,1433;Database=yiitest;Encrypt=no',             'username' => 'SA',             'password' => 'YourStrong!Passw0rd',             'fixture' => __DIR__ . '/mssql.sql',
AI Analysis
Vulnerability Existed: yes  
CWE-319: Cleartext Transmission of Sensitive Information - CWE ID 319 - tests/data/config.php [Lines 36-41]  
Old Code:  
```php
        'sqlsrv' => [
            'dsn' => 'sqlsrv:Server=127.0.0.1,1433;Database=yiitest',
            'username' => 'SA',
            'password' => 'YourStrong!Passw0rd',
            'fixture' => __DIR__ . '/mssql.sql',
```  
Fixed Code:  
```php
        'sqlsrv' => [
            'dsn' => 'sqlsrv:Server=127.0.0.1,1433;Database=yiitest;Encrypt=no',
            'username' => 'SA',
            'password' => 'YourStrong!Passw0rd',
            'fixture' => __DIR__ . '/mssql.sql',
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/base/ComponentTest.php AI: 2 vulnerabilities CVE-2024-58136
--- cache/yii2_2.0.51/tests/framework/base/ComponentTest.php	2025-10-29 14:10:01.451482096 +0000+++ cache/yii2_2.0.52/tests/framework/base/ComponentTest.php	2025-10-29 14:10:04.028645607 +0000@@ -10,6 +10,8 @@ use yii\base\Behavior; use yii\base\Component; use yii\base\Event;+use yii\base\InvalidConfigException;+use yii\base\UnknownMethodException; use yiiunit\TestCase;  function globalEventHandler($event)@@ -331,16 +333,45 @@          $this->assertSame($behavior, $component->detachBehavior('a'));         $this->assertFalse($component->hasProperty('p'));-        $this->expectException('yii\base\UnknownMethodException');-        $component->test();+        try {+            $component->test();+            $this->fail('Expected exception ' . UnknownMethodException::class . " wasn't thrown");+        } catch (UnknownMethodException $e) {+            // Expected+        } -        $p = 'as b';         $component = new NewComponent();-        $component->$p = ['class' => 'NewBehavior'];-        $this->assertSame($behavior, $component->getBehavior('a'));+        $component->{'as b'} = ['class' => NewBehavior::class];+        $this->assertInstanceOf(NewBehavior::class, $component->getBehavior('b'));         $this->assertTrue($component->hasProperty('p'));         $component->test();         $this->assertTrue($component->behaviorCalled);++        $component->{'as c'} = ['__class' => NewBehavior::class];+        $this->assertNotNull($component->getBehavior('c'));++        $component->{'as d'} = [+            '__class' => NewBehavior2::class,+            'class' => NewBehavior::class,+        ];+        $this->assertInstanceOf(NewBehavior2::class, $component->getBehavior('d'));++        // CVE-2024-4990+        try {+            $component->{'as e'} = [+                '__class' => 'NotExistsBehavior',+                'class' => NewBehavior::class,+            ];+            $this->fail('Expected exception ' . InvalidConfigException::class . " wasn't thrown");+        } catch (InvalidConfigException $e) {+            $this->assertSame('Class is not of type yii\base\Behavior or its subclasses', $e->getMessage());+        }++        $component = new NewComponent();+        $component->{'as f'} = function () {+            return new NewBehavior();+        };+        $this->assertNotNull($component->getBehavior('f'));     }      public function testAttachBehaviors()@@ -543,6 +574,10 @@     } } +class NewBehavior2 extends Behavior+{+}+ class NewComponent2 extends Component {     public $a;
AI Analysis
Vulnerability Existed: yes  
CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') - CWE-470 - tests/framework/base/ComponentTest.php [Lines 356-363]  
Old Code:  
```php  
        $component->{'as e'} = [  
            '__class' => 'NotExistsBehavior',  
            'class' => NewBehavior::class,  
        ];  
```  
Fixed Code:  
```php  
        try {  
            $component->{'as e'} = [  
                '__class' => 'NotExistsBehavior',  
                'class' => NewBehavior::class,  
            ];  
            $this->fail('Expected exception ' . InvalidConfigException::class . " wasn't thrown");  
        } catch (InvalidConfigException $e) {  
            $this->assertSame('Class is not of type yii\base\Behavior or its subclasses', $e->getMessage());  
        }  
```  

Vulnerability Existed: yes  
CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') - CWE-470 - tests/framework/base/ComponentTest.php [Lines 368-371]  
Old Code:  
```php  
        // No equivalent in old code  
```  
Fixed Code:  
```php  
        $component = new NewComponent();  
        $component->{'as f'} = function () {  
            return new NewBehavior();  
        };  
        $this->assertNotNull($component->getBehavior('f'));  
```
CVE Analysis Results:
CVE-2024-58136: Yes
View CVE 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.
tests/framework/base/ErrorExceptionTest.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/base/ErrorExceptionTest.php	2025-10-29 14:10:01.451482096 +0000+++ cache/yii2_2.0.52/tests/framework/base/ErrorExceptionTest.php	2025-10-29 14:10:04.028645607 +0000@@ -41,4 +41,13 @@             $this->assertEquals(__FUNCTION__, $e->getTrace()[0]['function']);         }     }++    public function testStrictError()+    {+        if (!defined('E_STRICT')) {+            $this->markTestSkipped('E_STRICT has been removed.');+        }+        $e = new ErrorException('', @E_STRICT);+        $this->assertEquals(PHP_VERSION_ID < 80400 ? 'PHP Strict Warning' : 'Error', $e->getName());+    } }
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - tests/framework/base/ErrorExceptionTest.php 44-48
```php
// Old code (test didn't exist)
```
```php
// Fixed code (new test added)
    public function testStrictError()
    {
        if (!defined('E_STRICT')) {
            $this->markTestSkipped('E_STRICT has been removed.');
        }
        $e = new ErrorException('', @E_STRICT);
        $this->assertEquals(PHP_VERSION_ID < 80400 ? 'PHP Strict Warning' : 'Error', $e->getName());
    }
```

**Analysis:**
The diff shows only the addition of a new test method `testStrictError()`. This is a test case that verifies the behavior of the `ErrorException::getName()` method when handling `E_STRICT` error codes, particularly in PHP 8.4+ where `E_STRICT` has been removed. There are no security vulnerabilities being fixed here - this is purely adding test coverage for existing functionality. The test uses the `@` operator to suppress potential warnings about undefined constants, which is appropriate for test code.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/base/WidgetTest.php AI: Not Sure
--- cache/yii2_2.0.51/tests/framework/base/WidgetTest.php	2025-10-29 14:10:01.451482096 +0000+++ cache/yii2_2.0.52/tests/framework/base/WidgetTest.php	2025-10-29 14:10:04.028645607 +0000@@ -72,6 +72,27 @@         $this->assertSame('<run-test>', $output);     } +    public function testDependencyInjectionWithCallableConfiguration()+    {+        Yii::$container = new Container();+        Yii::$container->setDefinitions([+            TestWidgetB::className() => function () {+                return new TestWidget(['id' => 'test']);+            }+        ]);++        ob_start();+        ob_implicit_flush(false);++        $widget = TestWidgetB::begin(['id' => 'test']);+        $this->assertTrue($widget instanceof TestWidget);+        TestWidgetB::end();++        $output = ob_get_clean();++        $this->assertSame('<run-test>', $output);+    }+     /**      * @depends testBeginEnd      */
AI Analysis
Vulnerability Existed: not sure  
CWE-798: Use of Hard-coded Credentials - CWE-798 - tests/framework/base/WidgetTest.php [75-81]  
[Old Code]  
```php
        Yii::$container->setDefinitions([
            TestWidgetB::className() => function () {
                return new TestWidget(['id' => 'test']);
            }
        ]);
```  
[Fixed Code]  
```php
        Yii::$container->setDefinitions([
            TestWidgetB::className() => function () {
                return new TestWidget(['id' => 'test']);
            }
        ]);
```  

Note: This appears to be a test case addition rather than a security fix. The code shows dependency injection configuration using callables, which is a legitimate pattern. No clear vulnerability is being fixed here - this seems to be adding test coverage for a feature.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/behaviors/AttributeTypecastBehaviorTest.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/behaviors/AttributeTypecastBehaviorTest.php	2025-10-29 14:10:01.452482160 +0000+++ cache/yii2_2.0.52/tests/framework/behaviors/AttributeTypecastBehaviorTest.php	2025-10-29 14:10:04.029645671 +0000@@ -7,11 +7,13 @@  namespace yiiunit\framework\behaviors; +use ValueError; use Yii; use yii\base\DynamicModel; use yii\base\Event; use yii\behaviors\AttributeTypecastBehavior; use yii\db\ActiveRecord;+use yiiunit\framework\db\enums\StatusTypeString; use yiiunit\TestCase;  /**@@ -47,6 +49,7 @@             'price' => 'float',             'isActive' => 'boolean',             'callback' => 'string',+            'status' => 'string',         ];         Yii::$app->getDb()->createCommand()->createTable('test_attribute_typecast', $columns)->execute();     }@@ -80,6 +83,55 @@         $this->assertSame('callback: foo', $model->callback);     } +    public function testTypecastEnum()+    {+        if (PHP_VERSION_ID < 80100) {+            $this->markTestSkipped('Can not be tested on PHP < 8.1');+        }++        $model = new ActiveRecordAttributeTypecastWithEnum();++        $model->status = StatusTypeString::Active;++        $model->getAttributeTypecastBehavior()->typecastAttributes();++        $this->assertSame(StatusTypeString::Active, $model->status);+    }++    /**+     * @depends testTypecastEnum+     */+    public function testTypecastEnumFromString()+    {+        if (PHP_VERSION_ID < 80100) {+            $this->markTestSkipped('Can not be tested on PHP < 8.1');+        }++        $model = new ActiveRecordAttributeTypecastWithEnum();+        $model->status = 'active'; // Same as StatusTypeString::ACTIVE->value;++        $model->getAttributeTypecastBehavior()->typecastAttributes();++        $this->assertSame(StatusTypeString::Active, $model->status);+    }++    /**+     * @depends testTypecastEnum+     */+    public function testTypecastEnumFailWithInvalidValue()+    {+        if (PHP_VERSION_ID < 80100) {+            $this->markTestSkipped('Can not be tested on PHP < 8.1');+        }++        $model = new ActiveRecordAttributeTypecastWithEnum();+        $model->status = 'invalid';++        self::expectException(ValueError::class);++        $model->getAttributeTypecastBehavior()->typecastAttributes();+    }+     /**      * @depends testTypecast      */@@ -332,6 +384,40 @@     }      /**+     * @return AttributeTypecastBehavior+     */+    public function getAttributeTypecastBehavior()+    {+        return $this->getBehavior('attributeTypecast');+    }+}++/**+ * Test Active Record class with [[AttributeTypecastBehavior]] behavior attached with an enum field.+ *+ * @property StatusTypeString $status+ */+class ActiveRecordAttributeTypecastWithEnum extends ActiveRecord+{+    public function behaviors()+    {+        return [+            'attributeTypecast' => [+                'class' => AttributeTypecastBehavior::className(),+                'attributeTypes' => [+                    'status' => StatusTypeString::class,+                ],+                'typecastBeforeSave' => true,+            ],+        ];+    }++    public static function tableName()+    {+        return 'test_attribute_typecast';+    }++    /**      * @return AttributeTypecastBehavior      */     public function getAttributeTypecastBehavior()
AI Analysis
Vulnerability Existed: no
No specific CWE - N/A - tests/framework/behaviors/AttributeTypecastBehaviorTest.php Various lines
[Old Code]
// Test file did not contain enum-related tests
[Fixed Code]
// Added tests for enum typecasting functionality

Vulnerability Existed: no
No specific CWE - N/A - tests/framework/behaviors/AttributeTypecastBehaviorTest.php Various lines
[Old Code]
// Test file did not have getAttributeTypecastBehavior method
[Fixed Code]
// Added getAttributeTypecastBehavior method for better test access

Note: The provided diff shows test code additions for enum support in AttributeTypecastBehavior. Since these are test files and the changes add functionality tests rather than fixing security issues, no vulnerabilities are identified. The changes appear to be adding support for PHP 8.1 enums in the typecasting behavior.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/caching/FileCacheTest.php AI: Not Sure
--- cache/yii2_2.0.51/tests/framework/caching/FileCacheTest.php	2025-10-29 14:10:01.453482223 +0000+++ cache/yii2_2.0.52/tests/framework/caching/FileCacheTest.php	2025-10-29 14:10:04.030645734 +0000@@ -82,4 +82,24 @@         $this->assertTrue(is_dir(dirname($cacheFile)), 'File not found ' . $cacheFile);         $this->assertEquals($value, $refMethodGet->invoke($cache, $key));     }++    public function testStatCache()+    {+        $cache = $this->getCacheInstance();+        $cache->set(__FUNCTION__, 'cache1', 2);++        $normalizeKey = $cache->buildKey(__FUNCTION__);+        $refClass = new \ReflectionClass($cache);+        $refMethodGetCacheFile = $refClass->getMethod('getCacheFile');+        $refMethodGetCacheFile->setAccessible(true);+        $cacheFile = $refMethodGetCacheFile->invoke($cache, $normalizeKey);++        // simulate cache expire 10 seconds ago+        touch($cacheFile, time() - 10);+        clearstatcache();++        $this->assertFalse($cache->get(__FUNCTION__));+        $this->assertTrue($cache->set(__FUNCTION__, 'cache2', 2));+        $this->assertSame('cache2', $cache->get(__FUNCTION__));+    } }
AI Analysis
Vulnerability Existed: not sure  
CWE-200: Information Exposure - tests/framework/caching/FileCacheTest.php 82-102  
Old Code:  
```php
    // No old code - this is a new test method being added
```  
Fixed Code:  
```php
    public function testStatCache()
    {
        $cache = $this->getCacheInstance();
        $cache->set(__FUNCTION__, 'cache1', 2);

        $normalizeKey = $cache->buildKey(__FUNCTION__);
        $refClass = new \ReflectionClass($cache);
        $refMethodGetCacheFile = $refClass->getMethod('getCacheFile');
        $refMethodGetCacheFile->setAccessible(true);
        $cacheFile = $refMethodGetCacheFile->invoke($cache, $normalizeKey);

        // simulate cache expire 10 seconds ago
        touch($cacheFile, time() - 10);
        clearstatcache();

        $this->assertFalse($cache->get(__FUNCTION__));
        $this->assertTrue($cache->set(__FUNCTION__, 'cache2', 2));
        $this->assertSame('cache2', $cache->get(__FUNCTION__));
    }
```

**Note:** This diff adds a new test method rather than fixing existing code. The test appears to validate cache expiration behavior by manipulating file timestamps. While this doesn't directly fix a security vulnerability, it could be related to ensuring proper cache invalidation which might have security implications (CWE-200: Information Exposure through caching of sensitive data). However, without more context about the actual cache implementation being tested, this is marked as "not sure".
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/console/ControllerTest.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/console/ControllerTest.php	2025-10-29 14:10:01.453482223 +0000+++ cache/yii2_2.0.52/tests/framework/console/ControllerTest.php	2025-10-29 14:10:04.030645734 +0000@@ -91,6 +91,12 @@         $this->assertEquals('from params', $fromParam);         $this->assertEquals('notdefault', $other); +        $params = ['a', 'b', 'c1', 'c2', 'c3'];+        [$a, $b, $c] = $controller->run('variadic', $params);+        $this->assertEquals('a', $a);+        $this->assertEquals('b', $b);+        $this->assertEquals(['c1', 'c2', 'c3'], $c);+         $params = ['avaliable'];         $message = Yii::t('yii', 'Missing required arguments: {params}', ['params' => implode(', ', ['missing'])]);         $this->expectException('yii\console\Exception');
AI Analysis
Vulnerability Existed: no
No specific vulnerability identified - N/A - tests/framework/console/ControllerTest.php [91-97]
[Old Code]
        $this->assertEquals('from params', $fromParam);
        $this->assertEquals('notdefault', $other);

[Fixed Code]
        $this->assertEquals('from params', $fromParam);
        $this->assertEquals('notdefault', $other);

        $params = ['a', 'b', 'c1', 'c2', 'c3'];
        [$a, $b, $c] = $controller->run('variadic', $params);
        $this->assertEquals('a', $a);
        $this->assertEquals('b', $b);
        $this->assertEquals(['c1', 'c2', 'c3'], $c);
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/console/FakeController.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/console/FakeController.php	2025-10-29 14:10:01.453482223 +0000+++ cache/yii2_2.0.52/tests/framework/console/FakeController.php	2025-10-29 14:10:04.030645734 +0000@@ -104,4 +104,9 @@         $response->exitStatus = (int) $status;         return $response;     }++    public function actionVariadic($foo, $bar, ...$baz)+    {+        return [$foo, $bar, $baz];+    } }
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - tests/framework/console/FakeController.php 104-109
[Old Code]
    }
}
[Fixed Code]
    }

    public function actionVariadic($foo, $bar, ...$baz)
    {
        return [$foo, $bar, $baz];
    }
}
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/db/CommandTest.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/db/CommandTest.php	2025-10-29 14:10:01.454482287 +0000+++ cache/yii2_2.0.52/tests/framework/db/CommandTest.php	2025-10-29 14:10:04.031645797 +0000@@ -1538,13 +1538,13 @@ 		    $db = $this->getConnection(); 		    $command = $db->createCommand(); -		    $command->setSql('SELECT :p1')->bindValues([':p1' => enums\Status::ACTIVE]);-		    $this->assertSame('ACTIVE', $command->params[':p1']);+		    $command->setSql('SELECT :p1')->bindValues([':p1' => enums\Status::Active]);+		    $this->assertSame('Active', $command->params[':p1']); -		    $command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeString::ACTIVE]);+		    $command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeString::Active]); 		    $this->assertSame('active', $command->params[':p1']); -		    $command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeInt::ACTIVE]);+		    $command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeInt::Active]); 		    $this->assertSame(1, $command->params[':p1']); 		} else {             $this->markTestSkipped('Enums are not supported in PHP < 8.1');
AI Analysis
Vulnerability Existed: no
No specific CWE - N/A - tests/framework/db/CommandTest.php Lines 1541-1549
Old Code:
```php
$command->setSql('SELECT :p1')->bindValues([':p1' => enums\Status::ACTIVE]);
$this->assertSame('ACTIVE', $command->params[':p1']);

$command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeString::ACTIVE]);
$this->assertSame('active', $command->params[':p1']);

$command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeInt::ACTIVE]);
$this->assertSame(1, $command->params[':p1']);
```
Fixed Code:
```php
$command->setSql('SELECT :p1')->bindValues([':p1' => enums\Status::Active]);
$this->assertSame('Active', $command->params[':p1']);

$command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeString::Active]);
$this->assertSame('active', $command->params[':p1']);

$command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeInt::Active]);
$this->assertSame(1, $command->params[':p1']);
```

This diff shows changes to test code only, specifically updating enum constant references from uppercase `ACTIVE` to PascalCase `Active`. These are test case modifications that verify the framework's enum handling behavior, not security fixes in production code. The changes appear to be related to test maintenance or refactoring rather than addressing security vulnerabilities.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/db/enums/Status.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/db/enums/Status.php	2025-10-29 14:10:01.455482350 +0000+++ cache/yii2_2.0.52/tests/framework/db/enums/Status.php	2025-10-29 14:10:04.032645861 +0000@@ -4,6 +4,6 @@  enum Status {-    case ACTIVE;-    case INACTIVE;+    case Active;+    case Inactive; }
AI Analysis
Vulnerability Existed: no
No specific CWE - N/A - tests/framework/db/enums/Status.php 4-5
Old Code:
    case ACTIVE;
    case INACTIVE;
Fixed Code:
    case Active;
    case Inactive;

Explanation: This change only modifies enum case names from uppercase to PascalCase. Since this is in a test file (tests/framework/db/enums/Status.php) and the change is purely cosmetic (naming convention), there is no security vulnerability being fixed. The modification appears to be for code style consistency rather than addressing any security issue.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/db/enums/StatusTypeInt.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/db/enums/StatusTypeInt.php	2025-10-29 14:10:01.455482350 +0000+++ cache/yii2_2.0.52/tests/framework/db/enums/StatusTypeInt.php	2025-10-29 14:10:04.032645861 +0000@@ -4,6 +4,6 @@  enum StatusTypeInt: int {-    case ACTIVE = 1;-    case INACTIVE = 0;+    case Active = 1;+    case Inactive = 0; }
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - tests/framework/db/enums/StatusTypeInt.php 4-5
Old Code:
    case ACTIVE = 1;
    case INACTIVE = 0;
Fixed Code:
    case Active = 1;
    case Inactive = 0;

Analysis: The changes in this diff are purely cosmetic, changing enum case names from uppercase to PascalCase. This appears to be a code style/consistency update rather than a security fix. The functionality remains identical - the enum values (1 and 0) are unchanged. Since this is test code and the modification doesn't affect security-related functionality, no security vulnerability is being addressed here.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/db/enums/StatusTypeString.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/db/enums/StatusTypeString.php	2025-10-29 14:10:01.455482350 +0000+++ cache/yii2_2.0.52/tests/framework/db/enums/StatusTypeString.php	2025-10-29 14:10:04.032645861 +0000@@ -4,6 +4,6 @@  enum StatusTypeString: string {-    case ACTIVE = 'active';-    case INACTIVE = 'inactive';+    case Active = 'active';+    case Inactive = 'inactive'; }
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - tests/framework/db/enums/StatusTypeString.php 4-6
```php
case ACTIVE = 'active';
case INACTIVE = 'inactive';
```
```php
case Active = 'active';
case Inactive = 'inactive';
```

**Analysis:** This diff shows a simple case change in enum member names from uppercase to PascalCase. The actual string values ('active', 'inactive') remain unchanged. This appears to be a code style/consistency change rather than a security fix. The file is in the tests directory, which typically contains test code rather than production code, further reducing security implications. No security vulnerability patterns (such as input validation, authentication, authorization, or data sanitization issues) are present in this change.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/helpers/ArrayHelperTest.php AI: No vulnerabilities
--- cache/yii2_2.0.51/tests/framework/helpers/ArrayHelperTest.php	2025-10-29 14:10:01.460482667 +0000+++ cache/yii2_2.0.52/tests/framework/helpers/ArrayHelperTest.php	2025-10-29 14:10:04.038646242 +0000@@ -734,6 +734,57 @@                 '345' => 'ccc',             ],         ], $result);++        $result = ArrayHelper::map($array,+            static function (array $group) {+                return $group['id'] . $group['name'];+            },+            static function (array $group) {+                return $group['name'] . $group['class'];+            }+        );++        $this->assertEquals([+            '123aaa' => 'aaax',+            '124bbb' => 'bbbx',+            '345ccc' => 'cccy',+        ], $result);++        $result = ArrayHelper::map($array,+            static function (array $group) {+                return $group['id'] . $group['name'];+            },+            static function (array $group) {+                return $group['name'] . $group['class'];+            },+            static function (array $group) {+                return $group['class'] . '-' . $group['class'];+            }+        );++        $this->assertEquals([+            'x-x' => [+                '123aaa' => 'aaax',+                '124bbb' => 'bbbx',+            ],+            'y-y' => [+                '345ccc' => 'cccy',+            ],+        ], $result);++        $array = [+            ['id' => '123', 'name' => 'aaa', 'class' => 'x', 'map' => ['a' => '11', 'b' => '22']],+            ['id' => '124', 'name' => 'bbb', 'class' => 'x', 'map' => ['a' => '33', 'b' => '44']],+            ['id' => '345', 'name' => 'ccc', 'class' => 'y', 'map' => ['a' => '55', 'b' => '66']],+        ];++        $result = ArrayHelper::map($array, 'map.a', 'map.b');++        $this->assertEquals([+            '11' => '22',+            '33' => '44',+            '55' => '66'+        ], $result);     }      public function testKeyExists()@@ -759,7 +810,7 @@         if (version_compare(PHP_VERSION, '8.1.0', '>=')) {             $this->markTestSkipped('Using floats as array key is deprecated.');         }-        +         $array = [             1 => 3,             2.2 => 4, // Note: Floats are cast to ints, which means that the fractional part will be truncated.@@ -1559,6 +1610,125 @@             ],         ];     }++    public function testFlatten()+    {+        // Test with deeply nested arrays+        $array = [+            'a' => [+                'b' => [+                    'c' => [+                        'd' => 1,+                        'e' => 2,+                    ],+                    'f' => 3,+                ],+                'g' => 4,+            ],+            'h' => 5,+        ];+        $expected = [+            'a.b.c.d' => 1,+            'a.b.c.e' => 2,+            'a.b.f' => 3,+            'a.g' => 4,+            'h' => 5,+        ];+        $this->assertEquals($expected, ArrayHelper::flatten($array));++        // Test with arrays containing different data types+        $array = [+            'a' => [+                'b' => [+                    'c' => 'string',+                    'd' => 123,+                    'e' => true,+                    'f' => null,+                ],+                'g' => [1, 2, 3],+            ],+        ];+        $expected = [+            'a.b.c' => 'string',+            'a.b.d' => 123,+            'a.b.e' => true,+            'a.b.f' => null,+            'a.g.0' => 1,+            'a.g.1' => 2,+            'a.g.2' => 3,+        ];+        $this->assertEquals($expected, ArrayHelper::flatten($array));++        // Test with arrays containing special characters in keys+        $array = [+            'a.b' => [+                'c.d' => [+                    'e.f' => 1,+                ],+            ],+            'g.h' => 2,+        ];+        $expected = [+            'a.b.c.d.e.f' => 1,+            'g.h' => 2,+        ];+        $this->assertEquals($expected, ArrayHelper::flatten($array));++        // Test with custom separator+        $array = [+            'a' => [+                'b' => [+                    'c' => [+                        'd' => 1,+                        'e' => 2,+                    ],+                    'f' => 3,+                ],+                'g' => 4,+            ],+            'h' => 5,+        ];+        $result = ArrayHelper::flatten($array, '_');+        $expected = [+            'a_b_c_d' => 1,+            'a_b_c_e' => 2,+            'a_b_f' => 3,+            'a_g' => 4,+            'h' => 5,+        ];++        $this->assertEquals($expected, $result);+    }++    public function testFlattenEdgeCases()+    {+        // Empty array+        $array = [];+        $expected = [];+        $this->assertEquals($expected, ArrayHelper::flatten($array));++        // Non-array value+        $array = 'string';+        $expected = ['string'];+        $this->expectException('yii\base\InvalidArgumentException');+        $this->expectExceptionMessage('Argument $array must be an array or implement Traversable');+        $this->assertEquals($expected, ArrayHelper::flatten($array));++        // Special characters in keys+        $array = ['a.b' => ['c.d' => 1]];+        $expected = ['a.b.c.d' => 1];+        $this->assertEquals($expected, ArrayHelper::flatten($array));++        // Mixed data types+        $array = ['a' => ['b' => 'string', 'c' => 123, 'd' => true, 'e' => null]];+        $expected = ['a.b' => 'string', 'a.c' => 123, 'a.d' => true, 'a.e' => null];+        $this->assertEquals($expected, ArrayHelper::flatten($array));++        // Key collisions+        $array = ['a' => ['b' => 1], 'a.b' => 2];+        $expected = ['a.b' => 2];+        $this->assertEquals($expected, ArrayHelper::flatten($array));+    } }  class Post1
AI Analysis
Vulnerability Existed: no
No specific vulnerability - N/A - tests/framework/helpers/ArrayHelperTest.php [Multiple lines]
[Old Code]
The original test file without the new test cases for ArrayHelper::map() and ArrayHelper::flatten()
[Fixed Code]
Added comprehensive test cases for ArrayHelper::map() with callable functions and nested array access, and added new testFlatten() and testFlattenEdgeCases() methods to test the flatten functionality
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/log/TargetTest.php AI: 1 vulnerabilities
--- cache/yii2_2.0.51/tests/framework/log/TargetTest.php	2025-10-29 14:10:01.461482731 +0000+++ cache/yii2_2.0.52/tests/framework/log/TargetTest.php	2025-10-29 14:10:04.041646432 +0000@@ -345,6 +345,45 @@         $logger->log('token.b', Logger::LEVEL_PROFILE_END, 'category');         $logger->log('token.a', Logger::LEVEL_PROFILE_END, 'category');     }++    public function testWildcardsInMaskVars()+    {+        $keys = [+            'PASSWORD',+            'password',+            'password_repeat',+            'repeat_password',+            'repeat_password_again',+            '1password',+            'password1',+        ];++        $password = '!P@$$w0rd#';++        $items = array_fill_keys($keys, $password);++        $GLOBALS['_TEST'] = array_merge(+            $items,+            ['a' => $items],+            ['b' => ['c' => $items]],+            ['d' => ['e' => ['f' => $items]]],+        );++        $target = new TestTarget([+            'logVars' => ['_SERVER', '_TEST'],+            'maskVars' => [+                // option 1: exact value(s)+                '_SERVER.DOCUMENT_ROOT',+                // option 2: pattern(s)+                '_TEST.*password*',+            ]+        ]);++        $message = $target->getContextMessage();++        $this->assertStringContainsString("'DOCUMENT_ROOT' => '***'", $message);+        $this->assertStringNotContainsString($password, $message);+    } }  class TestTarget extends Target
AI Analysis
Vulnerability Existed: yes
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor - CWE-200 - tests/framework/log/TargetTest.php 345-389
[Old Code]
    public function testWildcardsInMaskVars()
    {
        $keys = [
            'PASSWORD',
            'password',
            'password_repeat',
            'repeat_password',
            'repeat_password_again',
            '1password',
            'password1',
        ];

        $password = '!P@$$w0rd#';

        $items = array_fill_keys($keys, $password);

        $GLOBALS['_TEST'] = array_merge(
            $items,
            ['a' => $items],
            ['b' => ['c' => $items]],
            ['d' => ['e' => ['f' => $items]]],
        );

        $target = new TestTarget([
            'logVars' => ['_SERVER', '_TEST'],
            'maskVars' => [
                // option 1: exact value(s)
                '_SERVER.DOCUMENT_ROOT',
                // option 2: pattern(s)
                '_TEST.*password*',
            ]
        ]);

        $message = $target->getContextMessage();

        $this->assertStringContainsString("'DOCUMENT_ROOT' => '***'", $message);
        $this->assertStringNotContainsString($password, $message);
    }
[Fixed Code]
    public function testWildcardsInMaskVars()
    {
        $keys = [
            'PASSWORD',
            'password',
            'password_repeat',
            'repeat_password',
            'repeat_password_again',
            '1password',
            'password1',
        ];

        $password = '!P@$$w0rd#';

        $items = array_fill_keys($keys, $password);

        $GLOBALS['_TEST'] = array_merge(
            $items,
            ['a' => $items],
            ['b' => ['c' => $items]],
            ['d' => ['e' => ['f' => $items]]],
        );

        $target = new TestTarget([
            'logVars' => ['_SERVER', '_TEST'],
            'maskVars' => [
                // option 1: exact value(s)
                '_SERVER.DOCUMENT_ROOT',
                // option 2: pattern(s)
                '_TEST.*password*',
            ]
        ]);

        $message = $target->getContextMessage();

        $this->assertStringContainsString("'DOCUMENT_ROOT' => '***'", $message);
        $this->assertStringNotContainsString($password, $message);
    }

Note: This is a test case addition rather than a security fix. The vulnerability being addressed is the potential exposure of sensitive information (passwords) in logs when using wildcard patterns in maskVars. The test verifies that the masking functionality correctly handles wildcard patterns to prevent sensitive data leakage.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/validators/FileValidatorTest.php AI: Not Sure
--- cache/yii2_2.0.51/tests/framework/validators/FileValidatorTest.php	2025-10-29 14:10:01.463482858 +0000+++ cache/yii2_2.0.52/tests/framework/validators/FileValidatorTest.php	2025-10-29 14:10:04.043646559 +0000@@ -115,10 +115,11 @@         ]);         $m = FakedValidationModel::createWithAttributes(['attr_files' => 'path']);         $val->validateAttribute($m, 'attr_files');-        $this->assertFalse($m->hasErrors('attr_files'));+        $this->assertTrue($m->hasErrors('attr_files'));         $m = FakedValidationModel::createWithAttributes(['attr_files' => []]);         $val->validateAttribute($m, 'attr_files');-        $this->assertFalse($m->hasErrors('attr_files'));+        $this->assertTrue($m->hasErrors('attr_files'));+        $this->assertSame($val->uploadRequired, current($m->getErrors('attr_files')));          $m = FakedValidationModel::createWithAttributes(             [@@ -334,7 +335,7 @@                     'type' => 'image/png',                 ],             ]-        )[0];+        )[0]; // <-- only one file         $model = FakedValidationModel::createWithAttributes(['attr_images' => [$files]]);          $validator->validateAttribute($model, 'attr_images');@@ -422,7 +423,8 @@         $val->validateAttribute($m, 'attr_files');         $this->assertFalse($m->hasErrors());         $val->validateAttribute($m, 'attr_files_empty');-        $this->assertFalse($m->hasErrors('attr_files_empty'));+        $this->assertTrue($m->hasErrors('attr_files_empty'));+        $this->assertSame($val->uploadRequired, current($m->getErrors('attr_files_empty')));          // single File with skipOnEmpty = false         $val = new FileValidator(['skipOnEmpty' => false]);@@ -430,7 +432,8 @@         $val->validateAttribute($m, 'attr_files');         $this->assertFalse($m->hasErrors());         $val->validateAttribute($m, 'attr_files_empty');-        $this->assertFalse($m->hasErrors('attr_files_empty'));+        $this->assertTrue($m->hasErrors('attr_files_empty'));+        $this->assertSame($val->uploadRequired, current($m->getErrors('attr_files_empty')));         $m = $this->createModelForAttributeTest();          // too big@@ -689,7 +692,8 @@         $this->assertEquals($expected, $validator->validate($file), sprintf('Mime type validate fail: "%s" / "%s"', $mask, $fileMimeType));     } -    public function mimeTypeCaseInsensitive() {+    public function mimeTypeCaseInsensitive()+    {         return [             ['Image/*', 'image/jp2', true],             ['image/*', 'Image/jp2', true],
AI Analysis
Vulnerability Existed: not sure  
CWE-434: Unrestricted Upload of File with Dangerous Type - CWE-434 - tests/framework/validators/FileValidatorTest.php [Multiple locations]  
[Old Code]  
```php
$val->validateAttribute($m, 'attr_files');
$this->assertFalse($m->hasErrors('attr_files'));
```  
[Fixed Code]  
```php
$val->validateAttribute($m, 'attr_files');
$this->assertTrue($m->hasErrors('attr_files'));
$this->assertSame($val->uploadRequired, current($m->getErrors('attr_files')));
```

Vulnerability Existed: not sure  
CWE-434: Unrestricted Upload of File with Dangerous Type - CWE-434 - tests/framework/validators/FileValidatorTest.php [Multiple locations]  
[Old Code]  
```php
$val->validateAttribute($m, 'attr_files_empty');
$this->assertFalse($m->hasErrors('attr_files_empty'));
```  
[Fixed Code]  
```php
$val->validateAttribute($m, 'attr_files_empty');
$this->assertTrue($m->hasErrors('attr_files_empty'));
$this->assertSame($val->uploadRequired, current($m->getErrors('attr_files_empty')));
```

**Note:** This diff shows changes to test expectations, not the actual validator code. The changes indicate that the FileValidator now properly validates empty files and returns appropriate error messages when uploads are required. This suggests a fix for potential security issues where empty or missing files might bypass validation, but without seeing the actual FileValidator implementation changes, we cannot definitively identify specific vulnerabilities.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/web/RequestTest.php AI: Not Sure
--- cache/yii2_2.0.51/tests/framework/web/RequestTest.php	2025-10-29 14:10:01.464482921 +0000+++ cache/yii2_2.0.52/tests/framework/web/RequestTest.php	2025-10-29 14:10:04.044646622 +0000@@ -211,6 +211,124 @@         }     } +    public function testCustomSafeMethodsCsrfTokenValidation()+    {+        $this->mockWebApplication();++        $request = new Request();+        $request->csrfTokenSafeMethods = ['OPTIONS'];+        $request->enableCsrfCookie = false;+        $request->enableCsrfValidation = true;++        $token = $request->getCsrfToken();++        // accept any value on custom safe request+        foreach (['OPTIONS'] as $method) {+            $_SERVER['REQUEST_METHOD'] = $method;+            $this->assertTrue($request->validateCsrfToken($token));+            $this->assertTrue($request->validateCsrfToken($token . 'a'));+            $this->assertTrue($request->validateCsrfToken([]));+            $this->assertTrue($request->validateCsrfToken([$token]));+            $this->assertTrue($request->validateCsrfToken(0));+            $this->assertTrue($request->validateCsrfToken(null));+            $this->assertTrue($request->validateCsrfToken());+        }++        // only accept valid token on other requests+        foreach (['GET', 'HEAD', 'POST'] as $method) {+            $_SERVER['REQUEST_METHOD'] = $method;+            $this->assertTrue($request->validateCsrfToken($token));+            $this->assertFalse($request->validateCsrfToken($token . 'a'));+            $this->assertFalse($request->validateCsrfToken([]));+            $this->assertFalse($request->validateCsrfToken([$token]));+            $this->assertFalse($request->validateCsrfToken(0));+            $this->assertFalse($request->validateCsrfToken(null));+            $this->assertFalse($request->validateCsrfToken());+        }+    }++    public function testCsrfHeaderValidation()+    {+        $this->mockWebApplication();++        $request = new Request();+        $request->validateCsrfHeaderOnly = true;+        $request->enableCsrfValidation = true;++        // only accept valid header on unsafe requests+        foreach (['GET', 'HEAD', 'POST'] as $method) {+            $_SERVER['REQUEST_METHOD'] = $method;+            $request->headers->remove(Request::CSRF_HEADER);+            $this->assertFalse($request->validateCsrfToken());++            $request->headers->add(Request::CSRF_HEADER, '');+            $this->assertTrue($request->validateCsrfToken());+        }++        // accept no value on other requests+        foreach (['DELETE', 'PATCH', 'PUT', 'OPTIONS'] as $method) {+            $_SERVER['REQUEST_METHOD'] = $method;+            $this->assertTrue($request->validateCsrfToken());+        }+    }++    public function testCustomHeaderCsrfHeaderValidation()+    {+        $this->mockWebApplication();++        $request = new Request();+        $request->csrfHeader = 'X-JGURDA';+        $request->validateCsrfHeaderOnly = true;+        $request->enableCsrfValidation = true;++        // only accept valid header on unsafe requests+        foreach (['GET', 'HEAD', 'POST'] as $method) {+            $_SERVER['REQUEST_METHOD'] = $method;+            $request->headers->remove('X-JGURDA');+            $this->assertFalse($request->validateCsrfToken());++            $request->headers->add('X-JGURDA', '');+            $this->assertTrue($request->validateCsrfToken());+        }+    }++    public function testCustomUnsafeMethodsCsrfHeaderValidation()+    {+        $this->mockWebApplication();++        $request = new Request();+        $request->csrfHeaderUnsafeMethods = ['POST'];+        $request->validateCsrfHeaderOnly = true;+        $request->enableCsrfValidation = true;++        // only accept valid custom header on unsafe requests+        foreach (['POST'] as $method) {+            $_SERVER['REQUEST_METHOD'] = $method;+            $request->headers->remove(Request::CSRF_HEADER);+            $this->assertFalse($request->validateCsrfToken());++            $request->headers->add(Request::CSRF_HEADER, '');+            $this->assertTrue($request->validateCsrfToken());+        }++        // accept no value on other requests+        foreach (['GET', 'HEAD'] as $method) {+            $_SERVER['REQUEST_METHOD'] = $method;+            $request->headers->remove(Request::CSRF_HEADER);+            $this->assertTrue($request->validateCsrfToken());+        }+    }++    public function testNoCsrfTokenCsrfHeaderValidation()+    {+        $this->mockWebApplication();++        $request = new Request();+        $request->validateCsrfHeaderOnly = true;++        $this->assertEquals($request->getCsrfToken(), null);+    }+     public function testResolve()     {         $this->mockWebApplication([
AI Analysis
Vulnerability Existed: not sure  
CWE-352 Cross-Site Request Forgery (CSRF) - CWE-352 - tests/framework/web/RequestTest.php 211-319  
Old Code:  
```php  
// No previous test cases for CSRF header validation and custom safe methods  
```  
Fixed Code:  
```php  
    public function testCustomSafeMethodsCsrfTokenValidation()
    {
        $this->mockWebApplication();

        $request = new Request();
        $request->csrfTokenSafeMethods = ['OPTIONS'];
        $request->enableCsrfCookie = false;
        $request->enableCsrfValidation = true;

        $token = $request->getCsrfToken();

        // accept any value on custom safe request
        foreach (['OPTIONS'] as $method) {
            $_SERVER['REQUEST_METHOD'] = $method;
            $this->assertTrue($request->validateCsrfToken($token));
            $this->assertTrue($request->validateCsrfToken($token . 'a'));
            $this->assertTrue($request->validateCsrfToken([]));
            $this->assertTrue($request->validateCsrfToken([$token]));
            $this->assertTrue($request->validateCsrfToken(0));
            $this->assertTrue($request->validateCsrfToken(null));
            $this->assertTrue($request->validateCsrfToken());
        }

        // only accept valid token on other requests
        foreach (['GET', 'HEAD', 'POST'] as $method) {
            $_SERVER['REQUEST_METHOD'] = $method;
            $this->assertTrue($request->validateCsrfToken($token));
            $this->assertFalse($request->validateCsrfToken($token . 'a'));
            $this->assertFalse($request->validateCsrfToken([]));
            $this->assertFalse($request->validateCsrfToken([$token]));
            $this->assertFalse($request->validateCsrfToken(0));
            $this->assertFalse($request->validateCsrfToken(null));
            $this->assertFalse($request->validateCsrfToken());
        }
    }

    public function testCsrfHeaderValidation()
    {
        $this->mockWebApplication();

        $request = new Request();
        $request->validateCsrfHeaderOnly = true;
        $request->enableCsrfValidation = true;

        // only accept valid header on unsafe requests
        foreach (['GET', 'HEAD', 'POST'] as $method) {
            $_SERVER['REQUEST_METHOD'] = $method;
            $request->headers->remove(Request::CSRF_HEADER);
            $this->assertFalse($request->validateCsrfToken());

            $request->headers->add(Request::CSRF_HEADER, '');
            $this->assertTrue($request->validateCsrfToken());
        }

        // accept no value on other requests
        foreach (['DELETE', 'PATCH', 'PUT', 'OPTIONS'] as $method) {
            $_SERVER['REQUEST_METHOD'] = $method;
            $this->assertTrue($request->validateCsrfToken());
        }
    }

    public function testCustomHeaderCsrfHeaderValidation()
    {
        $this->mockWebApplication();

        $request = new Request();
        $request->csrfHeader = 'X-JGURDA';
        $request->validateCsrfHeaderOnly = true;
        $request->enableCsrfValidation = true;

        // only accept valid header on unsafe requests
        foreach (['GET', 'HEAD', 'POST'] as $method) {
            $_SERVER['REQUEST_METHOD'] = $method;
            $request->headers->remove('X-JGURDA');
            $this->assertFalse($request->validateCsrfToken());

            $request->headers->add('X-JGURDA', '');
            $this->assertTrue($request->validateCsrfToken());
        }
    }

    public function testCustomUnsafeMethodsCsrfHeaderValidation()
    {
        $this->mockWebApplication();

        $request = new Request();
        $request->csrfHeaderUnsafeMethods = ['POST'];
        $request->validateCsrfHeaderOnly = true;
        $request->enableCsrfValidation = true;

        // only accept valid custom header on unsafe requests
        foreach (['POST'] as $method) {
            $_SERVER['REQUEST_METHOD'] = $method;
            $request->headers->remove(Request::CSRF_HEADER);
            $this->assertFalse($request->validateCsrfToken());

            $request->headers->add(Request::CSRF_HEADER, '');
            $this->assertTrue($request->validateCsrfToken());
        }

        // accept no value on other requests
        foreach (['GET', 'HEAD'] as $method) {
            $_SERVER['REQUEST_METHOD'] = $method;
            $request->headers->remove(Request::CSRF_HEADER);
            $this->assertTrue($request->validateCsrfToken());
        }
    }

    public function testNoCsrfTokenCsrfHeaderValidation()
    {
        $this->mockWebApplication();

        $request = new Request();
        $request->validateCsrfHeaderOnly = true;

        $this->assertEquals($request->getCsrfToken(), null);
    }
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/web/session/AbstractDbSessionTest.php AI: Not Sure
--- cache/yii2_2.0.51/tests/framework/web/session/AbstractDbSessionTest.php	2025-10-29 14:10:01.465482985 +0000+++ cache/yii2_2.0.52/tests/framework/web/session/AbstractDbSessionTest.php	2025-10-29 14:10:04.045646686 +0000@@ -127,8 +127,9 @@         $session->db->createCommand()             ->update('session', ['expire' => time() - 100], 'id = :id', ['id' => 'expire'])             ->execute();-        $session->gcSession(1);+        $deleted = $session->gcSession(1); +        $this->assertEquals(1, $deleted);         $this->assertEquals('', $session->readSession('expire'));         $this->assertEquals('new data', $session->readSession('new'));     }
AI Analysis
Vulnerability Existed: not sure  
CWE-489: Active Debug Code - CWE-489 - tests/framework/web/session/AbstractDbSessionTest.php 130  
Old Code:  
```php
        $session->gcSession(1);
```  
Fixed Code:  
```php
        $deleted = $session->gcSession(1);

        $this->assertEquals(1, $deleted);
```  

**Note:** This change appears to be adding test assertions rather than fixing a security vulnerability. The modification improves test coverage by verifying the garbage collection return value, but doesn't appear to address any specific security issue in production code.
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.
tests/framework/web/session/SessionTest.php AI: Not Sure
--- cache/yii2_2.0.51/tests/framework/web/session/SessionTest.php	2025-10-29 14:10:01.465482985 +0000+++ cache/yii2_2.0.52/tests/framework/web/session/SessionTest.php	2025-10-29 14:10:04.045646686 +0000@@ -65,6 +65,7 @@             $this->assertNotEquals($oldUseCookies, $newUseCookies);             $this->assertFalse($newUseCookies);         }+        $session->setUseCookies($oldUseCookies);          $oldGcProbability = $session->getGCProbability();         $session->setGCProbability(100);
AI Analysis
Vulnerability Existed: not sure  
CWE-Unknown - Unknown - tests/framework/web/session/SessionTest.php 65  
[Old Code]  
```php
            $this->assertNotEquals($oldUseCookies, $newUseCookies);
            $this->assertFalse($newUseCookies);
        }
```  
[Fixed Code]  
```php
            $this->assertNotEquals($oldUseCookies, $newUseCookies);
            $this->assertFalse($newUseCookies);
        }
        $session->setUseCookies($oldUseCookies);
```
CVE Analysis Results:
CVE-2024-58136: No
View CVE 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.