CVE-2012-20007
9.8CriticalPublished 18 Nov 2026 · NVD status: Received · AI triage by gemini-3.1-flash-lite
Critical
0CVSS v3.110
- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User action
- None
- Impact
- Full C/I/A compromise
- Weakness
- CWE-95
What an attacker gets
Unauthenticated attackers can execute arbitrary PHP code on your server by sending a crafted request to index.php. This leads to full system compromise.
Root cause
The Dispatcher uses the preg_replace function with the /e modifier, which evaluates the replacement string as PHP code.
Affected versions
ThinkPHP 2.0 through 2.2 and 3.0 Lite mode.
CVSS v3.1 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Fix & remediation
Upgrade to a supported version of ThinkPHP that does not use the /e modifier in the Dispatcher. If you cannot upgrade, disable the affected application or block requests containing the 's' parameter in your web server configuration.
AI-suggested. Run it in staging first and check it against the vendor advisory. Why?
NVD 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.
References
- http://web.archive.org/web/20140201221754/http://www.jb51.net:80/softjc/43550.html
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/thinkphp/thinkphp-2-rce.yaml
- https://github.com/vulhub/vulhub/tree/master/thinkphp/2-rce
- https://www.vulncheck.com/advisories/thinkphp-2-x-3.0-lite-unauthenticated-rce-via-dispatcher-path-info