eosphoros-ai/db-gpt version 0.6.0 contains a vulnerability in the RAG-knowledge endpoint that allows for arbitrary file write. The issue arises from the ability to pass an absolute path to a call to `os.path.join`, enabling an attacker to write files to arbitrary locations on the target server. This vulnerability can be exploited by setting the `doc_file.filename` to an absolute path, which can lead to overwriting system files or creating new SSH-key entries.
The vulnerability results from improper file path handling in the `os.path.join` function call — when the `doc_file.filename` parameter contains an absolute path, the function ignores the previously defined base directory and uses only the provided absolute path. An attacker can thus set the `doc_file.filename` value to any absolute path in the server's file system (e.g. `/root/.ssh/authorized_keys`), resulting in writing controlled content outside the permitted area. The attack requires no authentication or user interaction.
An attacker can overwrite existing system files or create new files anywhere in the server's file system, which in practice can lead to permanent takeover of server control — for example by adding their own SSH key to the `authorized_keys` file.
Patches available from the vendor should be applied according to references. As a temporary measure, it is recommended to restrict network access to the RAG-knowledge endpoint and verify the integrity of critical system files and SSH entries on servers with the application installed.
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
Absolute Path Traversal w DB-GPT — zapis plików w dowolnej lokalizacji
Arbitrary file write przez path traversal w DB-GPT (knowledge API)
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