CVE-2026-39850
JSON

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 packageVersionsReported by
yiisoft yii2< 2.0.55CVE List
yiisoft/yii2 (Packagist)before 2.0.55GitHub Advisory Database

All scores

GitHub_M7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
GitHub7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Classification

CWE-20CWE-98

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

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

SourceRecordLicence
CVE ListCVE-2026-39850 changed 2026-05-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-5vpg-rj7q-qpw2 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-39850 changed 2026-07-23Public domain