CVE-2012-20007: TopThink ThinkPHP · Remote code execution
Exploitation: None known · CVSS 9.8 Critical · Unauthenticated · Published 2026-11-18
Description
ThinkPHP 2.0 through 2.2 and 3.0 Lite mode contains an eval injection vulnerability in the Dispatcher PATH_INFO parsing, which uses preg_replace with the /e modifier and a double-quoted replacement. Unauthenticated attackers can send crafted requests to index.php with a malicious 's' parameter containing PHP expressions to execute arbitrary code on the server. Exploitation evidence was first observed by the Shadowserver Foundation on 2023-10-14.
Enclave's analysis
ThinkPHP 2.x and 3.0 Lite mode run user-controlled URL path segments through preg_replace with the deprecated /e modifier, so a single unauthenticated GET request to index.php executes arbitrary PHP. Public PoCs (Vulhub, a Nuclei template) make this trivial to automate, and Shadowserver reported real exploitation in the wild back in 2023. The catch: the /e modifier only works on PHP below 7.0, so it only bites old, unmaintained stacks still on PHP 5.x. Hunt for legacy ThinkPHP 2.x/3.0 instances running on ancient PHP and retire or upgrade them.
Fix
No fixed version in the CVE record yet. Follow the vendor advisory.
Affected versions
| Product | Vulnerable | Fixed in |
|---|---|---|
| ThinkPHP | 2.0 through 2.2 | Not listed |
| ThinkPHP | 3.0 | Not listed |