/

CVE-2026-51864

Severity:

CRITICAL RISK

(9.1)

Directory Traversal (CWE-22) in DB-GPT Upload Endpoint

CVE-2026-51864

Deferred

Vulnerability type

Category:

Directory Traversal

CWE:

CWE-22

Impact:

Unauthorized File Write

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical directory traversal vulnerability in DB-GPT's Python file upload endpoint may allow a remote attacker to write files outside the intended workspace or storage boundary. The issue becomes risky when attacker-controlled path information reaches file-system operations without reliable canonicalization and boundary enforcement.

Affected context

The vulnerability occurs in the DB-GPT Python file upload API when uploaded files are stored using attacker-influenced path information. Deployments may be exposed when the endpoint is remotely reachable and the application does not consistently resolve paths and verify that the resulting location remains within the approved workspace or storage directory.

Exploit preconditions

  • Attack surface: The remotely reachable Python file upload endpoint - Required access: Network access to the endpoint; authentication requirements

depend on deployment configuration

  • Trigger point: Processing and storing a file upload - Why exploitation is possible: User-controlled path components can influence

the destination path, allowing writes beyond the intended directory when

canonicalization and boundary checks are incomplete

Why this happens

The underlying bug is improper limitation of a pathname to a trusted directory. When an application combines attacker-controlled path components with a storage directory without canonicalizing the result and enforcing a directory boundary, traversal sequences or equivalent path representations may escape the intended location. This behavior maps to CWE-22, Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Potential impact

  • An attacker may overwrite application or configuration files
  • Sensitive files could be damaged or replaced
  • The application may experience denial of service
  • File writes could enable code execution if a writable target is later loaded or executed
  • Compromise could extend to connected services or data depending on process privileges

General mitigation guidance

Mitigation generally centers on treating upload names and paths as untrusted data and constraining all writes to an explicitly approved directory. Common defensive patterns include resolving paths before use, rejecting any resolved path outside the configured boundary, generating server-side filenames, and avoiding user-controlled directory selection. Secure-by-default storage should use isolated, non-executable locations with restrictive permissions. Upload handling can also reduce trust through allowlisted file types, size limits, content validation, and least-privilege service accounts.

How teams detect issues like this

Detection approaches include static analysis for file-system APIs that combine upload input with paths, and code review checks for missing canonicalization or post-resolution boundary validation. Runtime monitoring can flag uploads whose normalized destinations fall outside approved directories, unexpected writes to application paths, and unusual file replacement activity. Policy enforcement can require isolated upload storage, server-generated filenames, and security tests for path-boundary violations. Automated review tools may help identify risky path construction patterns.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/164a2aff1229df650a5bcc2a039900c5
github.comgithub.com/eosphoros-ai/DB-GPT/issues/3027

Frequently asked

questions

It may be remotely exploitable when the Python upload endpoint is network

accessible and an attacker can submit uploads. Authentication and authorization

controls can limit exposure but do not replace safe path handling.

The attacker generally needs access to the upload operation and enough control

over upload-related path information to influence the destination. The exact

requirement depends on endpoint authentication and deployment configuration.

Resolve every destination path and verify that it remains within a dedicated,

non-executable upload directory. Prefer server-generated filenames and avoid

allowing clients to select storage paths.

Apply centralized upload handling, strict authorization, canonical path-boundary

checks, least-privilege file-system permissions, and automated tests and review

policies for traversal-sensitive code.

Find out what's already
exploitable in your codebase.