# CVE-2026-39850: Yii 2 Local File Inclusion in View rendering

Source: https://junglewise.ai/threats/cve-2026-39850-yii-2-local-file-inclusion-in-view-rendering  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-20. Updated: 2026-06-08  
License: CC BY 4.0 with a link back

CVE-2026-39850 · Severity: high · CVSS 7.4 · Published 2026-05-20

Yii 2 is a popular web development framework. A vulnerability in its page-rendering component allows an attacker to trick the system into reading sensitive files from the server. In some cases, this could lead to a complete takeover of the web application if the attacker can upload or find a way to execute malicious code.

Technologies: [yiisoft/yii2 (Packagist)](https://junglewise.ai/threats/technologies/yiisoft-yii2). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2026-39850 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-39850 being exploited in the wild.

**How severe is CVE-2026-39850?** High severity, with a CVSS score of 7.4, published 20 May 2026.

**Which products and versions are affected?** yiisoft/yii2 (Packagist) < 2.0.55, ECOSYSTEM:introduced=0,fixed=2.0.55; Yii Software Yii 2 <= 2.0.54.

**Is there a fix for CVE-2026-39850?** Yes. yiisoft/yii2 (Packagist): upgrade to 2.0.55 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-39850 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-39850?** Check whether you run yiisoft/yii2 (Packagist) or Yii Software Yii 2 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- yiisoft/yii2 (Packagist): upgrade to 2.0.55 or later

  ```sh
  composer require yiisoft/yii2:^2.0.55
  ```


## Technical details

The core view rendering method View::renderPhpFile() is vulnerable to Local File Inclusion (LFI) due to a variable name collision. The method calls PHP's extract() function on user-supplied parameters with the EXTR_OVERWRITE flag before requiring the view file. An attacker providing a parameter named '_file_' can overwrite the internal local variable used to determine which file is included. This allows for arbitrary file read of non-PHP files and potential Remote Code Execution (RCE) if the attacker can influence the content of a file on the local filesystem. The issue is fixed in version 2.0.55.

## Affected products

- yiisoft yii2 < 2.0.55

## Identifiers

- CVE-2026-39850
- GHSA-5vpg-rj7q-qpw2

## Timeline

- 2026-05-09: disclosed: Initial disclosure by reporter khuroohamid
- 2026-05-11: advisory: GitHub Advisory published
- 2026-05-11: patched: Version 2.0.55 released

## References

- [https://api.github.com/users/khuroohamid](https://api.github.com/users/khuroohamid)
- [https://github.com/khuroohamid](https://github.com/khuroohamid)
- [https://api.github.com/users/khuroohamid/gists%7B/gist_id%7D](https://api.github.com/users/khuroohamid/gists%7B/gist_id%7D)
- [https://api.github.com/users/khuroohamid/repos](https://api.github.com/users/khuroohamid/repos)
- [https://avatars.githubusercontent.com/u/40837886?v=4](https://avatars.githubusercontent.com/u/40837886?v=4)
- [https://api.github.com/users/khuroohamid/events%7B/privacy%7D](https://api.github.com/users/khuroohamid/events%7B/privacy%7D)

## Related threats

- [yiisoft/yii2 Mishandles the Attaching of Behavior Defined by a `__class` Array Key](https://junglewise.ai/threats/cve-2024-58136-yiiframework-yii-improper-protection-of-alternate-path)
- [Unsafe Reflection in base Component class in yiisoft/yii2](https://junglewise.ai/threats/cve-2024-4990-unsafe-reflection-in-base-component-class-in-yiisoft-yii2)
- [Reflected Cross-site Scripting in yiisoft/yii2 Debug mode](https://junglewise.ai/threats/cve-2024-32877-reflected-cross-site-scripting-in-yiisoft-yii2-debug-mode)
- [Yii2 allows attackers to execute any local .php file via a relative path in the view parameter](https://junglewise.ai/threats/cve-2015-5467-yii2-allows-attackers-to-execute-any-local-php-file-via-a-relative)
- [Withdrawn: SQL injection in Yii 2](https://junglewise.ai/threats/cve-2023-26750-withdrawn-sql-injection-in-yii-2)
