Summary
CVE-2019-25782 is a code injection vulnerability in ThinkPHP versions 5.0.0 through 5.0.23 that allows unauthenticated remote attackers to execute arbitrary commands. It is rated critical (CVSS v3.1 9.8; CVSS v4.0 9.3).
Technical details
- Root cause: the
_method=__constructparameter in a POST request lets an attacker overwrite properties of the Request object, including its filter property (the CVE record classifies this as CWE-470, Unsafe Reflection). - Trigger conditions: a POST request to endpoints such as
?s=captchaor?s=index/index/index, carrying a malicious filter value and server parameters. - Attack vector: network, no authentication or user interaction required.
- Impact: arbitrary command execution on the server hosting the application.
Affected software
- ThinkPHP 5.0.0 through 5.0.23
Severity
- CVSS v3.1: 9.8 Critical –
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS v4.0: 9.3 Critical –
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
Mitigation and recommended actions
- Immediate: upgrade ThinkPHP to 5.0.24 or later, which fixes the issue according to the CVE record.
- If patching is not immediately possible: restrict public access to affected applications (for example with a WAF or network ACLs) and monitor for POST requests containing
_method=__constructor unexpectedfilterparameters.

