CVE-2022-44289: Thinkphp has a code logic error
8.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.28512%
CWE
Published
12/6/2022
Updated
2/2/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| topthink/framework | composer | <= 5.0.24 | |
| topthink/framework | composer | >= 5.1, <= 5.1.41 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the checkImg() method's flawed validation logic. The original implementation checks if a file's extension is in the image list (gif/jpg/etc.) and its MIME type is invalid, returning an error only in that specific case. This allows files with non-image extensions (like .php) to bypass content validation entirely. When combined with ThinkPHP's move() method for uploads, this permits dangerous file types to be uploaded. The GitHub issue explicitly shows this function's logic inversion and demonstrates how it leads to getshell vulnerabilities.