CVE-2012-20007: ThinkPHP Eval Injection
Published 2026-11-18 · Updated 2026-11-21 · Source disclosure@vulncheck.com
Remotely exploitable without authentication — apply the vendor fix or mitigation as a priority.
What to do
- The advisory lists versions through 2.2 as affected and does not name a fixed release. Check the references below for a newer version of ThinkPHP or a vendor mitigation.
- Until it is patched, do not leave ThinkPHP reachable from the internet or other untrusted networks; restrict access by firewall, VPN or allow-list.
- Restrict access to the affected feature to trusted users until the fix is applied.
Affected and fixed versions
| Product | Affected | Fixed in |
|---|---|---|
| ThinkPHP | ≤ 2.2 | Not stated in the advisory |
Derived by HackerFeeds from the advisory text, CVSS vector and weakness class. Confirm versions against the vendor advisory before acting.
How it can be exploited
It can be exploited remotely over the network; the attacker does not need an account, and no action by a victim is required. Attack complexity is low, so a working exploit is expected to be reliable. The impact on confidentiality, integrity and availability is rated high.
| Attack vector | Network | It can be exploited remotely over the network. |
|---|---|---|
| Attack complexity | Low | No special conditions are needed; the attack is repeatable. |
| Privileges required | None | The attacker does not need an account. |
| User interaction | None | No action by a victim is needed. |
| Confidentiality | High | Total loss of confidentiality. |
| Integrity | High | Total loss of integrity. |
| Availability | High | Total loss of availability. |
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness: Eval Injection
Attacker-controlled input is passed to a code evaluation function, which usually means arbitrary code execution.
Classified as CWE-95.
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.
Advisory text as published in the NVD record.
References
- Advisoryhttps://www.vulncheck.com/advisories/thinkphp-2-x-3.0-lite-unauthenticated-rce-via-dispatcher-path-info
- Referencehttp://web.archive.org/web/20140201221754/http://www.jb51.net:80/softjc/43550.html
- Referencehttps://github.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/thinkphp/thinkphp-2-rce.yaml
- Referencehttps://github.com/vulhub/vulhub/tree/master/thinkphp/2-rce