ThinkPHP 5.0.23 contains a remote code execution vulnerability that allows unauthenticated attackers to execute arbitrary PHP code by invoking functions through the routing parameter. Attackers can craft requests to the index.php endpoint with malicious function parameters to execute system commands with application privileges.
The vulnerability results from insufficient validation of routing parameters in the index.php endpoint. An unauthenticated attacker can craft an HTTP request containing malicious function parameters, which are then passed to the framework's function invocation mechanism (invokeFunction). In this way, the attacker can invoke any PHP function, including system functions that enable shell command execution with the privileges of the web application process.
An unauthenticated attacker can execute arbitrary system commands on the server with application privileges, which may lead to complete server takeover, data theft, or installation of malicious software.
Apply patches available from the vendor according to the references. It is recommended to immediately update the ThinkPHP framework to a version higher than 5.0.23 and restrict access to the index.php endpoint at the firewall level in case immediate update deployment is not possible.
ThinkPHP version 5.0.23
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XThinkphp
APPThinkphp5.1.315.0.0 – 5.0.23 (excl.)
Related vulnerabilities
RCE w funkcji read sterownika szablonów ThinkPHP 5.0.24
RCE w ThinkPHP 3 — wykonanie kodu przez komponent index.php
RCE w ThinkPHP 5.1 przez funkcję routecheck
ThinkPHP: RCE poprzez deserializację w Index.php (CVE-2024-48112)
Krytyczna podatność deserialization RCE w ThinkPHP v6.1.3–v8.0.4