# CVE-2026-48820: CakePHP: View::element() is missing a path containment check

> Attackers can exploit missing path checks in CakePHP's View::element() to include arbitrary PHP files, potentially leading to code execution or data disclosure.

- **Severity:** Medium 6.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Jun 2026
- **Updated:** 18 Jun 2026
- **Also known as:** CLSA-2026-1783904619, DEBIAN-CVE-2026-48820, GHSA-wpvj-hjcr-h3p2, UBUNTU-CVE-2026-48820

## What is CVE-2026-48820?

CVE-2026-48820 is a medium-severity path traversal vulnerability in cakephp, published on 17 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

CakePHP is a rapid development framework for PHP. In versions 4.5.11 and earlier, 4.6.0 through 4.6.3, 5.0.0 through 5.1.6, 5.2.0 through 5.2.12, and 5.3.0 through 5.3.5, 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. Patched releases are available in 5.3.6, 5.2.13, 5.1.7, 4.6.4, and 4.5.11.

Weakness: CWE-98 (Improper Control of Filename for Include/Require Statement in PHP Program), CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-48820?

10 open source packages ship an affected version, including cakephp/cakephp.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cakephp/cakephp` | Packagist | All versions | 4.5.11 |
| `cakephp/cakephp` | Packagist | All versions | 4.5.11 |
| `cakephp/cakephp` | Packagist | From 4.6.0 | 4.6.4 |
| `cakephp/cakephp` | Packagist | From 4.6.0 | 4.6.4 |
| `cakephp/cakephp` | Packagist | From 5.0.0 | 5.1.7 |
| `cakephp/cakephp` | Packagist | From 5.0.0 | 5.1.7 |
| `cakephp/cakephp` | Packagist | From 5.2.0 | 5.2.13 |
| `cakephp/cakephp` | Packagist | From 5.2.0 | 5.2.13 |
| `cakephp/cakephp` | Packagist | From 5.3.0 | 5.3.6 |
| `cakephp/cakephp` | Packagist | From 5.3.0 | 5.3.6 |

## How do I fix CVE-2026-48820?

Upgrade cakephp/cakephp to a fixed version for your release line: 4.5.11, 4.6.4, 5.1.7 or 5.2.13.

## Is CVE-2026-48820 being exploited?

There is no known exploitation of CVE-2026-48820 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-48820 and fix it if it is affected.

What it is: CVE-2026-48820 is a medium-severity path traversal vulnerability in cakephp, published on 17 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-48820 in the wild and no public exploit code.

Affected packages and fixed versions:
- cakephp/cakephp (Packagist): affected all versions; fixed in 4.5.11
- cakephp/cakephp (Packagist): affected all versions; fixed in 4.5.11
- cakephp/cakephp (Packagist): affected from 4.6.0; fixed in 4.6.4
- cakephp/cakephp (Packagist): affected from 4.6.0; fixed in 4.6.4
- cakephp/cakephp (Packagist): affected from 5.0.0; fixed in 5.1.7
- cakephp/cakephp (Packagist): affected from 5.0.0; fixed in 5.1.7
- cakephp/cakephp (Packagist): affected from 5.2.0; fixed in 5.2.13
- cakephp/cakephp (Packagist): affected from 5.2.0; fixed in 5.2.13
- cakephp/cakephp (Packagist): affected from 5.3.0; fixed in 5.3.6
- cakephp/cakephp (Packagist): affected from 5.3.0; fixed in 5.3.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-48820/ (Markdown: https://insights.sbomify.com/CVE-2026-48820/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-48820
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-48820
- OSV: https://osv.dev/vulnerability/CVE-2026-48820

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-48820/
Summaries are generated and may contain mistakes; the official description above is the record.
