ThinkPHP 2.x/3.0 Lite Unauthenticated RCE (CVE-2012-20007)

Unauthenticated RCE in ThinkPHP 2.0-2.2 and 3.0 Lite via crafted 's' parameter; exploitation observed in the wild.

ThinkPHP 2.0 through 2.2 and 3.0 Lite mode are vulnerable to unauthenticated remote code execution via the Dispatcher PATH_INFO parsing. The vulnerable code uses preg_replace with the /e modifier and a double-quoted replacement, allowing an attacker to inject PHP expressions in the 's' parameter of requests to index.php. Shadowserver Foundation first observed exploitation on 2023-10-14. No fixed version is stated in the supplied NVD references; verify the current ThinkPHP vendor advisory before upgrading production systems.

What to do 1. Identify any ThinkPHP 2.0-2.2 or 3.0 Lite mode installations in your environment. 2. Upgrade to a supported ThinkPHP release after confirming the vendor's recommended fixed version from the official advisory. 3. If an immediate upgrade is not possible, block or restrict external access to index.php and apply WAF rules that inspect the 's' parameter for PHP expressions. 4. Review access logs for exploitation attempts using crafted 's' parameters, especially from 2023-10-14 onward. 5. Re-check the NVD entry and vendor advisory for updated fixed version details before changing production.

References: NVD, VulnCheck, nuclei template, vulhub

Sources