Summary
CVE-2026-51864 is a critical path traversal vulnerability (CWE-22) in DB-GPT’s python_file_upload endpoint, affecting versions 0.7.5 and 0.8.0. An authenticated attacker can supply a crafted filename containing directory traversal sequences to write arbitrary Python files outside the intended upload directory, which can lead to remote code execution. The vulnerability carries a CVSS v3.1 base score of 9.1 (Critical).
Technical details
- Root cause: the
POST /api/v1/python/uploadendpoint (python_upload_api.py) uses the client-suppliedfile.filenamefrom a multipart upload directly when writing to disk, without sanitizing directory traversal sequences (../) or validating that the resolved path stays within the designated upload directory. - The only validation performed on the uploaded filename is that it ends with a
.pyextension. - Trigger conditions: an attacker with a valid authentication token submits a file upload request with a filename such as
../../../../dbgpt/agent/backdoor.py, causing the server to write the file outside the intended workspace boundary. - Attack vector is network-based, requires low attack complexity, and no user interaction.
- Impact: arbitrary file write to locations accessible by the DB-GPT application, which can be leveraged to plant Python files in locations later loaded/executed by the application, enabling code injection and persistent backdoors.
Affected software
- DB-GPT (eosphoros-ai) version 0.7.5
- DB-GPT (eosphoros-ai) version 0.8.0
Severity
- CVSS v3.1 Base Score: 9.1 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Mitigation and recommended actions
- Immediate: Upgrade DB-GPT to a version that includes the fix merged via the project’s corresponding pull request addressing the
python_file_uploadpath traversal issue; confirm with the vendor that the patched release is applied. - If no patch can be applied immediately: restrict access to the
/api/v1/python/uploadendpoint to trusted users only, enforce strict filename validation/allow-listing at a reverse proxy or WAF layer to block path traversal sequences (../, absolute paths), and monitor the DB-GPT file storage directories for unexpected Python files written outside expected upload paths. - Review authentication and authorization controls for all file upload endpoints exposed by DB-GPT, since exploitation requires only a valid authenticated session token.

