/

CVE-2026-51912

Severity:

CRITICAL RISK

(9.8)

Directory Traversal (CWE-22) in OpenBMB XAgent Upload

CVE-2026-51912

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Potential unauthorized file access or modification

Severity:

CRITICAL RISK

(9.8)

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

OpenBMB XAgent v1.0.0 has a directory traversal vulnerability in the ToolServer upload-file handler. If an attacker can supply a path that the handler does not properly confine, they may cause file operations to reach locations outside the intended upload directory.

OpenBMB XAgent v1.0.0 has a directory traversal vulnerability in the ToolServer upload-file handler. If an attacker can supply a path that the handler does not properly confine, they may cause file operations to reach locations outside the intended upload directory.

Affected context

The reported issue is in ToolServer/ToolServerNode/main.py at line 46, in the upload-file handling logic. It becomes risky when a path or filename influenced by a request is used for file operations without reliably restricting the resolved destination to an approved directory. The available description does not specify the exact access controls or which file operations are possible.

The reported issue is in ToolServer/ToolServerNode/main.py at line 46, in the upload-file handling logic. It becomes risky when a path or filename influenced by a request is used for file operations without reliably restricting the resolved destination to an approved directory. The available description does not specify the exact access controls or which file operations are possible.

Exploit preconditions

  • Attack surface: The ToolServer upload-file operation
  • Required access: Ability to invoke the operation; whether authentication or authorization is required depends on deployment configuration.
  • Trigger point: Handling an upload whose path or filename influences the destination.
  • Why exploitation is possible: If path components are not safely normalized and constrained, the resolved destination may escape the intended upload directory.
  • Attack surface: The ToolServer upload-file operation
  • Required access: Ability to invoke the operation; whether authentication or authorization is required depends on deployment configuration.
  • Trigger point: Handling an upload whose path or filename influences the destination.
  • Why exploitation is possible: If path components are not safely normalized and constrained, the resolved destination may escape the intended upload directory.

Why this happens

Directory traversal maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. The underlying bug class is using externally influenced path data for filesystem operations without ensuring the final resolved path remains within an approved base directory. The reported description identifies the upload handler but does not provide further implementation details.

Directory traversal maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. The underlying bug class is using externally influenced path data for filesystem operations without ensuring the final resolved path remains within an approved base directory. The reported description identifies the upload handler but does not provide further implementation details.

Potential impact

  • An attacker may be able to write or overwrite files outside the intended upload directory, depending on handler behavior and process permissions.
  • Sensitive files could potentially be exposed if the operation permits reads or otherwise reveals file contents.
  • Changes to application files or configuration could affect service integrity or availability.
  • An attacker may be able to write or overwrite files outside the intended upload directory, depending on handler behavior and process permissions.
  • Sensitive files could potentially be exposed if the operation permits reads or otherwise reveals file contents.
  • Changes to application files or configuration could affect service integrity or availability.

General mitigation guidance

Common defensive patterns include:

  • Treating client-supplied filenames and paths as untrusted; prefer server-generated names and fixed destination directories.
  • Canonicalizing the destination and verifying it remains within an explicitly allowed base directory before file operations.
  • Rejecting path separators and unexpected path components where subdirectories are not required.
  • Applying least-privilege filesystem permissions so the service cannot modify unrelated files.
  • Separating upload storage from application code and sensitive configuration.

Common defensive patterns include:

  • Treating client-supplied filenames and paths as untrusted; prefer server-generated names and fixed destination directories.
  • Canonicalizing the destination and verifying it remains within an explicitly allowed base directory before file operations.
  • Rejecting path separators and unexpected path components where subdirectories are not required.
  • Applying least-privilege filesystem permissions so the service cannot modify unrelated files.
  • Separating upload storage from application code and sensitive configuration.

How teams detect issues like this

  • Review upload code for filesystem paths constructed from request-controlled values.
  • Use static analysis rules to flag path joins, file writes, or file opens involving untrusted input without containment checks.
  • Add tests and policy checks that verify resolved upload destinations remain within the designated storage root.
  • Monitor upload-related filesystem activity for unexpected destinations or changes to sensitive paths. Automated code review tools may help identify risky path-handling patterns.
  • Review upload code for filesystem paths constructed from request-controlled values.
  • Use static analysis rules to flag path joins, file writes, or file opens involving untrusted input without containment checks.
  • Add tests and policy checks that verify resolved upload destinations remain within the designated storage root.
  • Monitor upload-related filesystem activity for unexpected destinations or changes to sensitive paths. Automated code review tools may help identify risky path-handling patterns.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/9999d9e504c5238dc48a023ef7c51d01
github.comgithub.com/OpenBMB/XAgent

Frequently asked

questions

The report identifies the upload-file handler in OpenBMB XAgent v1.0.0. The practical scope depends on how that handler is exposed and what filesystem permissions the process has.

An attacker must be able to invoke the upload operation and influence path-related input. The description does not state whether authentication is required.

Use server-controlled destination names and verify that every resolved destination stays within a designated upload directory before performing filesystem operations.

Treat paths from requests as untrusted, enforce containment checks, restrict service filesystem permissions, and test upload paths against traversal outside the permitted storage area.

The report identifies the upload-file handler in OpenBMB XAgent v1.0.0. The practical scope depends on how that handler is exposed and what filesystem permissions the process has.

An attacker must be able to invoke the upload operation and influence path-related input. The description does not state whether authentication is required.

Use server-controlled destination names and verify that every resolved destination stays within a designated upload directory before performing filesystem operations.

Treat paths from requests as untrusted, enforce containment checks, restrict service filesystem permissions, and test upload paths against traversal outside the permitted storage area.

Find out what's already
exploitable in your codebase.