Skip to content
Laskyr

yiisoft/yii2 security advisory

CVE-2026-39850: Yii 2: Local file inclusion via view parameter name collision

CVE-2026-39850 is a high-severity file inclusion vulnerability in the PHP package yiisoft/yii2 (CVSS 7.4), published 20 May 2026. It is fixed in 2.0.55; earlier versions are affected. It can be exploited without an account.

high 7.4 published 2026-05-20 · updated 2026-07-23

Fixed in yiisoft/yii2 2.0.55

This file inclusion issue affects yiisoft/yii2 versions < 2.0.55. Upgrade to the fixed version for your release line (2.0.55). The newest release, 2.0.55, is not affected.

Affected versions
< 2.0.55
Fixed in
2.0.55
Newest release
2.0.55
Severity
High · CVSS 7.4
Type
File inclusion
CWE-20, CWE-98
Exploited in the wild
Not on the CISA KEV list
checked 2026-11-04

Is your yiisoft/yii2 version affected?

Run composer show yiisoft/yii2 in your project, then enter the version. We check it against this and every other known yiisoft/yii2 advisory.

Who can exploit CVE-2026-39850

CVSS vector (scored by GitHub): CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Your app is only exposed if it uses the affected part of yiisoft/yii2. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-39850 in yiisoft/yii2

  1. Find the installed version: composer show yiisoft/yii2. If you never required it yourself, composer why yiisoft/yii2 shows which package pulls it in.
  2. Update it: composer update yiisoft/yii2 --with-all-dependencies. You need 2.0.55 or newer.
  3. If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example "yiisoft/yii2": "^2.0.55" if you can take that version), or upgrade the package that requires it.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-39850.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for file inclusion issues while the upgrade waits. None of it replaces the fix.

The CVE-2026-39850 advisory

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.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-39850. Advisory title: “Yii 2: Local file inclusion via view parameter name collision”.

References

Other yiisoft/yii2 advisories

Related

Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.

Ask about a fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit