# CVE-2024-5982: Path Traversal in gaizhenbiao/chuanhuchatgpt

- Severity: Critical 9.1 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 31.1%, higher than 98% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-10-29T12:46:24.726Z
- Modified: 2026-06-17T08:17:02.023Z
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: @huntr_ai

## Description

A path traversal vulnerability exists in the latest version of gaizhenbiao/chuanhuchatgpt. The vulnerability arises from unsanitized input handling in multiple features, including user upload, directory creation, and template loading. Specifically, the load_chat_history function in modules/models/base_model.py allows arbitrary file uploads, potentially leading to remote code execution (RCE). The get_history_names function in utils.py permits arbitrary directory creation. Additionally, the load_template function in utils.py can be exploited to leak the first column of CSV files. These issues stem from improper sanitization of user inputs concatenated with directory paths using os.path.join.

(As written by CVE List.)

## Affected

- gaizhenbiao gaizhenbiao/chuanhuchatgpt: from unspecified before 20240918
- gaizhenbiao gaizhenbiao\/chuanhuchatgpt: before 20240918
- gaizhenbiao chuanhuchatgpt: before 20240918

## Every score

- @huntr_ai: CVSS:3.0 9.1 Critical `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H`
- CISA-ADP: CVSS:3.1 9.1 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://huntr.com/bounties/5d5c5356-e893-44d1-b5ca-642aa05d96bb> (exploit)
- <https://github.com/gaizhenbiao/chuanhuchatgpt/commit/952fc8c3cbacead858311747cddd4bedcb4721d7> (patch)

## Sources

- CVE List: [CVE-2024-5982](https://www.cve.org/CVERecord?id=CVE-2024-5982), CVE Terms of Use, modified 2024-10-29
- NVD: [CVE-2024-5982](https://nvd.nist.gov/vuln/detail/CVE-2024-5982), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-5982 · Whole record: https://cve.day/CVE-2024-5982.json · Rebuilt by cve.day 2026-11-25T22:58:47.482Z
