CVE-2026-39850: Yii 2 Local File Inclusion Vulnerability

HIGH
Advisory Identifier: GHSA-5vpg-rj7q-qpw2
CVSS 7.4
CWE-98 CWE-20
Published
Advisory Summary

CVE-2026-39850 is a HIGH (CVSS 7.4) local file inclusion vulnerability (CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')) affecting Yii 2 libraries in the Packagist ecosystem. The issue involves local file inclusion via view parameter name collision. Remediation is available by upgrading affected packages to version 2.0.55.

CVE-2026-39850 at a Glance

CVE Identifier CVE-2026-39850
GHSA Identifier GHSA-5vpg-rj7q-qpw2
Severity HIGH
CVSS v3.1 Base Score 7.4
CWE Classification CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
Affected Product Yii 2
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-39850

To remediate this vulnerability, upgrade all affected Yii 2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

yiisoft/yii2 fixed: 2.0.55
Upgrade yiisoft/yii2 to 2.0.55
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for yiisoft/yii2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-39850, inspect your project dependencies for Yii 2:

inspect dependencies for yiisoft/yii2

Analyze the terminal output to locate any version of Yii 2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.55), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion'), where the php application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in "require," "include," or similar functions. In Yii 2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2026-39850 Affected Yii 2 Versions

1 component(s)
Fixed Versions:
2.0.55
Product / Package Ecosystem Affected Versions Fixed Version
yiisoft/yii2
Packagist
< 2.0.55
2.0.55

References

Frequently Asked Questions

What is CVE-2026-39850?
CVE-2026-39850 is a security vulnerability in Yii 2 involving Local file inclusion via view parameter name collision under CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion').
Which Yii 2 versions are affected?
Affected versions include releases prior to 2.0.55 across affected packages: yiisoft/yii2.
What version fixes CVE-2026-39850?
Upgrading to 2.0.55 (or the latest patched release for your respective branch) resolves the vulnerability.
Is yiisoft/yii2 affected?
Yes, yiisoft/yii2 is affected in releases prior to 2.0.55. Upgrade your dependency to 2.0.55 or later.
What is the CVSS score of CVE-2026-39850?
CVE-2026-39850 has a CVSS v3.1 base score of 7.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-39850?
CVE-2026-39850 is classified under CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') (The PHP application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in "require," "include," or similar functions.).
How can I check Packagist dependencies for CVE-2026-39850?
Run the dependency tree command: 'inspect dependencies for yiisoft/yii2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5vpg-rj7q-qpw2",
  "modified" : "2026-06-08T20:14:36Z",
  "published" : "2026-05-11T19:34:28Z",
  "aliases" : [ "CVE-2026-39850" ],
  "summary" : "Yii 2: Local file inclusion via view parameter name collision",
  "details" : "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.\n\n### Impact\n\n- Local File Inclusion (arbitrary file read via non-PHP files)\n- Potential RCE if attacker can write PHP files via a separate primitive\n- Information disclosure\n\n### Patches\n\n2.0.55\n\n### Workarounds\n\nNo.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "yiisoft/yii2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.55"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/yiisoft/yii2/security/advisories/GHSA-5vpg-rj7q-qpw2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39850"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yiisoft/yii2/commit/109878b491dbffa541032bc99fb5e26d12cd0375"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/yiisoft/yii2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yiisoft/yii2/releases/tag/2.0.55"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-98" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-11T19:34:28Z",
    "nvd_published_at" : "2026-05-20T20:16:39Z"
  }
}