7.4high
Yii 2: Local file inclusion via view parameter name collision
- Severity
- 7.4high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.46% (higher than 41% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-5vpg-rj7q-qpw2
Description
Yii 2 is a PHP application framework. Versions 2.0.54 and prior contain flawed logic in the core view rendering method View::renderPhpFile() that leads to Local File Inclusion. The function calls extract($_params_, EXTR_OVERWRITE) before the require statement that loads the view file. As a result, a caller-controlled _file_ key in the $params array overwrites the internal local variable specifying which file to include, potentially enabling RCE if an attacker can write PHP files through a separate primitive, as well as information disclosure. This issue has been fixed in version 2.0.55.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| yiisoft yii2 | < 2.0.55 | CVE List |
| yiisoft/yii2 (Packagist) | before 2.0.55 | GitHub Advisory Database |
All scores
| GitHub_M | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
| GitHub | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
Classification
What each source says
CVE List
Yii 2 is a PHP application framework. Versions 2.0.54 and prior contain flawed logic in the core view rendering method View::renderPhpFile() that leads to Local File Inclusion. The function calls extract($_params_, EXTR_OVERWRITE) before the require statement that loads the view file. As a result, a caller-controlled _file_ key in the $params array overwrites the internal local variable specifying which file to include, potentially enabling RCE if an attacker can write PHP files through a separate primitive, as well as information disclosure. This issue has been fixed in version 2.0.55.
GitHub Advisory Database
The core view rendering method View::renderPhpFile() calls extract($_params_, EXTR_OVERWRITE) before the require statement that includes the view file. A caller-controlled parameter named _file_ in the $params array overwrites the internal local variable that specifies which file is included — enabling a Local File Inclusion primitive.
Impact
- Local File Inclusion (arbitrary file read via non-PHP files)
- Potential RCE if attacker can write PHP files via a separate primitive
- Information disclosure
Patches
2.0.55
Workarounds
No.
NVD (es)
Yii 2 es un framework de aplicación PHP. Las versiones 2.0.54 y anteriores contienen lógica defectuosa en el método central de renderizado de vistas View::renderPhpFile() que conduce a una inclusión local de ficheros. La función llama a extract($_params_, EXTR_OVERWRITE) antes de la sentencia require que carga el fichero de vista. Como resultado, una clave _file_ controlada por el llamador en el array $params sobrescribe la variable local interna que especifica qué fichero incluir, lo que podría habilitar RCE si un atacante puede escribir ficheros PHP a través de una primitiva separada, así como revelación de información. Este problema ha sido corregido en la versión 2.0.55.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-39850 changed 2026-05-21 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5vpg-rj7q-qpw2 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-39850 changed 2026-07-23 | Public domain |