/

CVE-2026-51862

Severity:

CRITICAL RISK

(9.1)

Directory Traversal (CWE-22) in DB-GPT skill_upload

CVE-2026-51862

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary 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

DB-GPT 0.8.0 contains a directory traversal flaw in the skill_upload API that may allow an attacker to write files outside the intended workspace or storage directory. The issue becomes risky when the endpoint is remotely reachable and uploaded file paths are not securely constrained to an approved destination.

DB-GPT 0.8.0 contains a directory traversal flaw in the skill_upload API that may allow an attacker to write files outside the intended workspace or storage directory. The issue becomes risky when the endpoint is remotely reachable and uploaded file paths are not securely constrained to an approved destination.

Affected context

The vulnerability occurs in DB-GPT's agentic data API, specifically the skill_upload functionality in agentic_data_api.py. It may affect deployments where the upload endpoint is exposed to remote clients and destination paths are derived from attacker-influenced input without reliable canonicalization and boundary enforcement.

The vulnerability occurs in DB-GPT's agentic data API, specifically the skill_upload functionality in agentic_data_api.py. It may affect deployments where the upload endpoint is exposed to remote clients and destination paths are derived from attacker-influenced input without reliable canonicalization and boundary enforcement.

Exploit preconditions

  • Attack surface: The remotely reachable skill_upload API endpoint
  • Required access: Network access to the endpoint; authentication requirements depend on deployment configuration
  • Trigger point: Processing an upload request and resolving its destination path
  • Why exploitation is possible: Attacker-controlled path components can escape the intended workspace or storage boundary when path validation does not reliably enforce the permitted directory
  • Attack surface: The remotely reachable skill_upload API endpoint
  • Required access: Network access to the endpoint; authentication requirements depend on deployment configuration
  • Trigger point: Processing an upload request and resolving its destination path
  • Why exploitation is possible: Attacker-controlled path components can escape the intended workspace or storage boundary when path validation does not reliably enforce the permitted directory

Why this happens

The underlying bug is improper limitation of a user-controlled file path. When an application combines attacker-influenced path components with a trusted base directory without robust canonicalization and containment checks, traversal sequences may resolve outside the intended storage location.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The insecure pattern is trusting a syntactically acceptable path before confirming that its resolved filesystem location remains within an explicitly authorized directory.

The underlying bug is improper limitation of a user-controlled file path. When an application combines attacker-influenced path components with a trusted base directory without robust canonicalization and containment checks, traversal sequences may resolve outside the intended storage location.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The insecure pattern is trusting a syntactically acceptable path before confirming that its resolved filesystem location remains within an explicitly authorized directory.

Potential impact

  • An attacker may write or overwrite files outside the intended upload directory
  • Application configuration or runtime files could be modified
  • The service may experience denial of service or altered behavior
  • Written files could enable further compromise if later executed or loaded by privileged processes
  • Sensitive data may be damaged or affected indirectly
  • An attacker may write or overwrite files outside the intended upload directory
  • Application configuration or runtime files could be modified
  • The service may experience denial of service or altered behavior
  • Written files could enable further compromise if later executed or loaded by privileged processes
  • Sensitive data may be damaged or affected indirectly

General mitigation guidance

Mitigation generally focuses on reducing trust in client-provided paths and enforcing storage boundaries at multiple layers.

Common defensive patterns include:

  • Deriving server-side filenames and destinations instead of accepting arbitrary paths
  • Canonicalizing paths and verifying that resolved destinations remain under an approved directory
  • Rejecting traversal components, symlink escapes, absolute paths, and alternate path representations
  • Restricting uploads to dedicated, non-executable storage locations
  • Applying least-privilege permissions to the service account and its writable directories
  • Using filesystem isolation and read-only mounts where practical
  • Limiting endpoint exposure and requiring authorization for file-write operations

Mitigation generally focuses on reducing trust in client-provided paths and enforcing storage boundaries at multiple layers.

Common defensive patterns include:

  • Deriving server-side filenames and destinations instead of accepting arbitrary paths
  • Canonicalizing paths and verifying that resolved destinations remain under an approved directory
  • Rejecting traversal components, symlink escapes, absolute paths, and alternate path representations
  • Restricting uploads to dedicated, non-executable storage locations
  • Applying least-privilege permissions to the service account and its writable directories
  • Using filesystem isolation and read-only mounts where practical
  • Limiting endpoint exposure and requiring authorization for file-write operations

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules that identify filesystem writes using request-derived path components
  • Code review checks for missing canonicalization, containment validation, or symlink handling
  • Tests covering traversal representations, absolute paths, encoded separators, and boundary-prefix confusion
  • Runtime monitoring for writes outside approved application directories
  • File integrity monitoring on configuration, executable, and service-owned files
  • API policy enforcement that restricts upload destinations and validates authorization before writing

Organizations can look for this weakness through:

  • Static analysis rules that identify filesystem writes using request-derived path components
  • Code review checks for missing canonicalization, containment validation, or symlink handling
  • Tests covering traversal representations, absolute paths, encoded separators, and boundary-prefix confusion
  • Runtime monitoring for writes outside approved application directories
  • File integrity monitoring on configuration, executable, and service-owned files
  • API policy enforcement that restricts upload destinations and validates authorization before writing

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/c09e6aca2e9c7280ca4fabb1f44dcd2a
github.comgithub.com/eosphoros-ai/DB-GPT/issues/3026

Frequently asked

questions

Potentially. A remote attacker may exploit the issue when the skill_upload endpoint is reachable and accepts attacker-controlled upload or destination-path input.

Authentication requirements depend on how DB-GPT is deployed and how the endpoint is protected. Any account or network position permitted to invoke the upload operation may be relevant.

Use server-controlled storage destinations, canonicalize resolved paths, and enforce that every destination remains within an approved non-executable directory.

Combine strict authorization, path-boundary checks, upload-specific filesystem permissions, negative and positive-path testing, and monitoring for unexpected writes outside designated storage locations.

Potentially. A remote attacker may exploit the issue when the skill_upload endpoint is reachable and accepts attacker-controlled upload or destination-path input.

Authentication requirements depend on how DB-GPT is deployed and how the endpoint is protected. Any account or network position permitted to invoke the upload operation may be relevant.

Use server-controlled storage destinations, canonicalize resolved paths, and enforce that every destination remains within an approved non-executable directory.

Combine strict authorization, path-boundary checks, upload-specific filesystem permissions, negative and positive-path testing, and monitoring for unexpected writes outside designated storage locations.

Find out what's already
exploitable in your codebase.