{"id":"CVE-2024-5982","published":"2024-10-29T12:46:24Z","modified":"2024-10-29T13:47:03Z","title":"Path Traversal in gaizhenbiao/chuanhuchatgpt","vendor":"gaizhenbiao","product":"gaizhenbiao/chuanhuchatgpt","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.1,"severity":"CRITICAL","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.31081,"percentile":0.98306,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://huntr.com/bounties/5d5c5356-e893-44d1-b5ca-642aa05d96bb","tags":[]},{"url":"https://github.com/gaizhenbiao/chuanhuchatgpt/commit/952fc8c3cbacead858311747cddd4bedcb4721d7","tags":[]}],"priority":{"score":26.0,"factors":[{"name":"EPSS percentile","points":19.66},{"name":"CVSS severity","points":6.37}]},"vendorSlug":"gaizhenbiao","affectedVersions":[{"vendor":"gaizhenbiao","product":"gaizhenbiao/chuanhuchatgpt","versions":[">= unspecified, < 20240918"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2024-10-29T13:44:27.936584Z","from":"CISA ADP","provenance":"source"},"summary":{"text":"Path traversal flaws in gaizhenbiao/chuanhuchatgpt, a chat application, affect its user upload, directory creation, and template loading features, with the load_chat_history function in modules/models/base_model.py, get_history_names and load_template in utils.py, all stemming from unsanitized user input concatenated into directory paths via os.path.join. An attacker who can reach the application over the network without authentication or user interaction can upload arbitrary files, which may lead to remote code execution, create arbitrary directories, and leak the first column of CSV files.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T05:39:12Z"},"euvd":{"id":"EUVD-2024-47099","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-gaizhenbiao-chuanhuchatgpt-cve-2024-4520","parents":[{"from":"CVE-2024-4520","to":"CVE-2024-5982","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["modules/models/base_model.py"],"commits":["https://github.com/gaizhenbiao/chuanhuchatgpt/commit/ccc7479ace5c9e1a1d9f4daf2e794ffd3865fc2b","https://github.com/gaizhenbiao/chuanhuchatgpt/commit/952fc8c3cbacead858311747cddd4bedcb4721d7"],"basis":"shared function","functions":["load_chat_history"]}]},{"from":"CVE-2024-3404","to":"CVE-2024-5982","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["modules/models/base_model.py"],"commits":["https://github.com/gaizhenbiao/chuanhuchatgpt/commit/ccc7479ace5c9e1a1d9f4daf2e794ffd3865fc2b","https://github.com/gaizhenbiao/chuanhuchatgpt/commit/952fc8c3cbacead858311747cddd4bedcb4721d7"],"basis":"shared function","functions":["load_chat_history"]}]}],"children":[{"from":"CVE-2024-5982","to":"CVE-2024-8143","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["modules/models/base_model.py"],"commits":["https://github.com/gaizhenbiao/chuanhuchatgpt/commit/952fc8c3cbacead858311747cddd4bedcb4721d7","https://github.com/gaizhenbiao/chuanhuchatgpt/commit/ccc7479ace5c9e1a1d9f4daf2e794ffd3865fc2b"],"basis":"shared function","functions":["load_chat_history"]}]}]}}