In eosphoros-ai/db-gpt version 0.6.0, the endpoint for uploading files is vulnerable to absolute path traversal. This vulnerability allows an attacker to upload arbitrary files to arbitrary locations on the target server. The issue arises because the `file_key` and `doc_file.filename` parameters are user-controllable, enabling the construction of paths outside the intended directory. This can lead to overwriting essential system files, such as SSH keys, for further exploitation.
The vulnerability results from lack of validation of the `file_key` and `doc_file.filename` parameters, which are fully controlled by the user. By properly crafting the values of these parameters, an attacker can construct an absolute path that extends beyond the intended target directory. As a result, the uploaded file is placed at the location specified by the attacker in the server's file system, including system directories. An example of exploitation is overwriting SSH keys, which enables further actions after gaining access.
An attacker can overwrite or place arbitrary files in critical operating system locations, such as SSH keys, which may lead to complete server takeover. The vulnerability enables both data destruction and creation of a persistent foothold for further exploitation.
Patches available from the vendor should be applied according to references. Additionally, it is recommended to restrict access to the file upload endpoint only to authenticated and authorized users, and to implement strict validation and sanitization of paths on the server side.
eosphoros-ai/DB-GPT version 0.6.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:HDbgpt Db Gpt
APPDbgpt0.6.0
Related vulnerabilities
Dowolne wykonanie kodu przez niekontrolowane SQL API w db-gpt
Arbitrary file write przez path traversal w DB-GPT (knowledge API)
Dowolny zapis plików w db-gpt przez podatność path traversal w RAG-knowledge
SQL Injection i zapis plików w db-gpt umożliwiające RCE
Arbitrary File Upload z Path Traversal w db-gpt — możliwy RCE