# CVE-2010-4335: CakePHP allows remote attackers to modify internal Cake cache and execute arbitrary code

> Remote attackers can execute arbitrary code by sending crafted data that triggers unsafe deserialization in the CakePHP security component.

- **Severity:** High 7.5 (`AV:N/AC:L/Au:N/C:P/I:P/A:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Jan 2011
- **Updated:** 7 Aug 2024
- **Also known as:** DEBIAN-CVE-2010-4335, GHSA-g2vx-8v47-4vhh

## What is CVE-2010-4335?

CVE-2010-4335 is a high-severity unsafe deserialization vulnerability in n/a, published on 14 Jan 2011. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The _validatePost function in libs/controller/components/security.php in CakePHP 1.3.x through 1.3.5 and 1.2.8 allows remote attackers to modify the internal Cake cache and execute arbitrary code via a crafted data[_Token][fields] value that is processed by the unserialize function, as demonstrated by modifying the file_map cache to execute arbitrary local files.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2010-4335?

2 open source packages ship an affected version, including cakephp/cakephp. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cakephp/cakephp` | Packagist | From 1.2.8 | 1.3.6 |
| `cakephp/cakephp` | Packagist | From 1.2.8 | 1.3.6 |

Products: Cakefoundation Cakephp, Cakephp Cakephp.

## How do I fix CVE-2010-4335?

Upgrade cakephp/cakephp to 1.3.6 or later.

## Is CVE-2010-4335 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2010-4335 exists.

Public exploit code:

- CakePHP Cache Corruption Code Execution (metasploit)
- CakePHP 1.3.5/1.2.8 - Cache Corruption (Metasploit) (exploitdb)
- CakePHP 1.3.5/1.2.8 - 'Unserialize()' File Inclusion (exploitdb)

## Other vulnerabilities in n/a

- [CVE-2012-4399](https://insights.sbomify.com/CVE-2012-4399/): CakePHPallows remote attackers to read arbitrary files via XML data containing external entity references (high 7.5)
- [CVE-2020-15400](https://insights.sbomify.com/CVE-2020-15400/): Cross-Site Request Forgery in CakePHP (medium 4.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2010-4335 and fix it if it is affected.

What it is: CVE-2010-4335 is a high-severity unsafe deserialization vulnerability in n/a, published on 14 Jan 2011. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2010-4335 exists.

Affected packages and fixed versions:
- cakephp/cakephp (Packagist): affected from 1.2.8; fixed in 1.3.6
- cakephp/cakephp (Packagist): affected from 1.2.8; fixed in 1.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-2010-4335/ (Markdown: https://insights.sbomify.com/CVE-2010-4335/index.md)
```

## Sources

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

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