CVE-2026-48820: CakePHP View::element() Is Missing A Path Vulnerability

MODERATE
Advisory Identifier: GHSA-wpvj-hjcr-h3p2
CWE-22
Published
Advisory Summary

CVE-2026-48820 is a MODERATE view::element() is missing a path vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting CakePHP libraries in the Packagist ecosystem. The issue involves view::element() is missing a path containment check. Remediation is available by upgrading affected packages to version 5.3.6, 5.2.13, 5.1.7, 4.6.4, 4.5.11.

CVE-2026-48820 at a Glance

CVE Identifier CVE-2026-48820
GHSA Identifier GHSA-wpvj-hjcr-h3p2
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product CakePHP
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-48820

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

cakephp/cakephp fixed: 5.3.6
Upgrade cakephp/cakephp to 5.3.6
cakephp/cakephp fixed: 5.2.13
Upgrade cakephp/cakephp to 5.2.13
cakephp/cakephp fixed: 5.1.7
Upgrade cakephp/cakephp to 5.1.7
cakephp/cakephp fixed: 4.6.4
Upgrade cakephp/cakephp to 4.6.4
cakephp/cakephp fixed: 4.5.11
Upgrade cakephp/cakephp to 4.5.11
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 cakephp/cakephp

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-48820, inspect your project dependencies for CakePHP:

inspect dependencies for cakephp/cakephp

Analyze the terminal output to locate any version of CakePHP in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.3.6), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In CakePHP, 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

### Impact `View::_getElementFileName()` does not check that the resolved element path is within the application/plugin view template paths. When element names are created with specifically crafted user-supplied data this weakness can be leveraged to include other PHP files on the server. ### Patches Patched releases are available in 5.3.6, 5.2.13, 5.1.7, 4.6.4, and 4.5.11. ### Workarounds If developers are not using user-supplied data in element names, no action is required.

CVE-2026-48820 Affected CakePHP Versions

5 component(s)
Fixed Versions:
5.3.65.2.135.1.74.6.44.5.11
Product / Package Ecosystem Affected Versions Fixed Version
cakephp/cakephp
Packagist
≥ 5.3.0
< 5.3.6
5.3.6
cakephp/cakephp
Packagist
≥ 5.2.0
< 5.2.13
5.2.13
cakephp/cakephp
Packagist
≥ 5.0.0
< 5.1.7
5.1.7
cakephp/cakephp
Packagist
≥ 4.6.0
< 4.6.4
4.6.4
cakephp/cakephp
Packagist
< 4.5.11
4.5.11

References

Frequently Asked Questions

What is CVE-2026-48820?
CVE-2026-48820 is a security vulnerability in CakePHP involving View::element() is missing a path containment check under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which CakePHP versions are affected?
Affected versions include releases prior to 5.3.6, 5.2.13, 5.1.7, 4.6.4, 4.5.11 across affected packages: cakephp/cakephp.
What version fixes CVE-2026-48820?
Upgrading to 5.3.6, 5.2.13, 5.1.7, 4.6.4, 4.5.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cakephp/cakephp affected?
Yes, cakephp/cakephp is affected in releases prior to 5.3.6, 5.2.13, 5.1.7, 4.6.4, 4.5.11. Upgrade your dependency to 5.3.6, 5.2.13, 5.1.7, 4.6.4, 4.5.11 or later.
What CWE is associated with CVE-2026-48820?
CVE-2026-48820 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Packagist dependencies for CVE-2026-48820?
Run the dependency tree command: 'inspect dependencies for cakephp/cakephp'. 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-wpvj-hjcr-h3p2",
  "modified" : "2026-06-26T21:00:10Z",
  "published" : "2026-06-26T21:00:10Z",
  "aliases" : [ "CVE-2026-48820" ],
  "summary" : "CakePHP: View::element() is missing a path containment check",
  "details" : "### Impact\n`View::_getElementFileName()` does not check that the resolved element path is within the application/plugin view template paths. When element names are created with specifically crafted user-supplied data this weakness can be leveraged to include other PHP files on the server.\n\n### Patches\nPatched releases are available in 5.3.6, 5.2.13, 5.1.7, 4.6.4, and 4.5.11.\n\n### Workarounds\nIf developers are not using user-supplied data in element names, no action is required.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.0"
      }, {
        "fixed" : "5.3.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.2.0"
      }, {
        "fixed" : "5.2.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.6.0"
      }, {
        "fixed" : "4.6.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/security/advisories/GHSA-wpvj-hjcr-h3p2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-48820"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cakephp/cakephp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-26T21:00:10Z",
    "nvd_published_at" : "2026-06-17T22:16:22Z"
  }
}