In eosphoros-ai/db-gpt version v0.6.0, the web API `POST /v1/personal/agent/upload` is vulnerable to Arbitrary File Upload with Path Traversal. This vulnerability allows unauthorized attackers to upload arbitrary files to the victim's file system at any location. The impact of this vulnerability includes the potential for remote code execution (RCE) by writing malicious files, such as a malicious `__init__.py` in the Python's `/site-packages/` directory.
The API endpoint does not properly validate the target path of the uploaded file, enabling a path traversal attack (CWE-22). An unauthenticated attacker can construct an HTTP request containing traversal sequences in the filename or path, causing the file to be written outside the intended directory. An example attack scenario involves placing a malicious `__init__.py` file in the Python `/site-packages/` directory, which results in code execution when the package is subsequently imported by the application.
An attacker can write arbitrary files to any location on the server's file system, which consequently enables remote code execution (RCE) and complete system compromise.
Patches available from the vendor should be applied according to the references. Additionally — until the fix is deployed — it is recommended to restrict access to the `POST /v1/personal/agent/upload` endpoint at the firewall or reverse proxy level and require authentication for all API calls.
eosphoros-ai/db-gpt in version v0.6.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HDbgpt Db Gpt
APPDbgpt0.6.0
Related vulnerabilities
SQL Injection i zapis plików w db-gpt umożliwiające RCE
Absolute Path Traversal w DB-GPT — zapis plików w dowolnej lokalizacji
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
Dowolne wykonanie kodu przez niekontrolowane SQL API w db-gpt