What’s Vulnerable › Vulnerabilities
CVE-2024-5278: Unrestricted File Upload leading to RCE in gaizhenbiao/chuanhuchatgpt
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.6% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2024-06-06 · updated 2026-06-17
- Weakness: CWE-434
Description
gaizhenbiao/chuanhuchatgpt is vulnerable to an unrestricted file upload vulnerability due to insufficient validation of uploaded file types in its `/upload` endpoint. Specifically, the `handle_file_upload` function does not sanitize or validate the file extension or content type of uploaded files, allowing attackers to upload files with arbitrary extensions, including HTML files containing XSS payloads and Python files. This vulnerability, present in the latest version as of 20240310, could lead to stored XSS attacks and potentially result in remote code execution (RCE) on the server hosting the application.
Affected products
- gaizhenbiao/chuanhuchatgpt: before 20240919 — fixed in 20240919
How to fix
Upgrade to a fixed version: gaizhenbiao/chuanhuchatgpt 20240919. Check the vendor advisory for mitigations.
References
- https://github.com/gaizhenbiao/chuanhuchatgpt/commit/22007a77f037c0cf76180f9b73a8d19e87dad02e
- https://huntr.com/bounties/ea821d86-941b-40f3-a857-91f758848e05
- https://huntr.com/bounties/ea821d86-941b-40f3-a857-91f758848e05
Get alerted when CVE-2024-5278 or the next vulnerability affects your stack