CVE-2022-44289
Description
Thinkphp 5.1.41 and 5.0.24 has a code logic error which causes file upload getshell.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A code logic error in ThinkPHP 5.1.41 and 5.0.24 allows file upload with arbitrary extensions, leading to remote code execution.
A code logic error in the checkImg() method of ThinkPHP's File.php causes improper validation of uploaded files. In versions 5.1.41 and 5.0.24, the method is intended to restrict uploads to image file extensions but contains a flawed conditional that inadvertently permits files with extensions such as .php to pass validation [2]. The bug arises from a reversed boolean logic in the image type check, where files that are not valid images are incorrectly accepted.
An attacker can exploit this vulnerability by uploading a malicious PHP file through any controller that uses the file move() method, as demonstrated in the official documentation examples. No authentication is required if the upload endpoint is publicly accessible. The validation bypass occurs because the checkImg() function returns true for non-image files when it should return false, allowing the upload to proceed [2].
Successful exploitation grants the attacker the ability to execute arbitrary PHP code on the server by accessing the uploaded file directly. This can lead to full system compromise, including data theft, privilege escalation, and lateral movement within the network.
ThinkPHP has addressed this issue in subsequent releases. Users are strongly advised to upgrade to a patched version or implement a custom file validation filter as a workaround. The vulnerability is publicly documented and proof-of-concept code is available [1][2].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
topthink/frameworkPackagist | <= 5.0.24 | — |
topthink/frameworkPackagist | >= 5.1, <= 5.1.41 | — |
Affected products
2- Thinkphp/Thinkphpdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
3- github.com/advisories/GHSA-59fh-rjq3-xq7jghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-44289ghsaADVISORY
- github.com/top-think/framework/issues/2772ghsaWEB
News mentions
0No linked articles in our index yet.