/

CVE-2026-26396

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in OpenBMB XAgent file API

CVE-2026-26396

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Sensitive Information Disclosure via Filesystem Access

Severity:

HIGH RISK

(7.5)

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 before and including version 1.0.0 contains a path traversal flaw in the file() handler, where a user-controlled filename parameter is concatenated into a filesystem path without proper validation.

When attackers can influence this parameter, they may traverse directories and read arbitrary files on the server, exposing sensitive configuration, credentials, or other confidential data.

Affected context

This vulnerability appears in OpenBMB XAgent deployments that expose the XAgentServer workspace routes, specifically the file() function in XAgent/XAgentServer/application/routers/workspace.py.

It is relevant when the application reads files from a server-side workspace based on a filename supplied by the client, and the server does not normalize or strictly constrain the requested path to a safe directory.

Environments where the application runs with access to configuration files, logs, or other sensitive resources are at higher risk, especially if the service is reachable over a network.

Exploit preconditions

  • Attack surface: HTTP or API endpoint that calls the file() function in the workspace router.
  • Required access: Ability to send requests to the affected endpoint and control the filename parameter (typically unauthenticated or authenticated web/API client).
  • Trigger point: The server-side logic concatenates the provided filename with a base directory and reads the resulting path.
  • Why exploitation is possible: The implementation does not properly normalize or validate the filename value, allowing sequences such as parent directory references to escape the intended workspace and access arbitrary readable files within the process's filesystem permissions.

Why this happens

The root cause aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The file() function directly concatenates a user-supplied filename into a filesystem path without enforcing a strict allowlist, canonicalizing the resulting path, or checking that it remains within an expected base directory.

This insecure pattern allows clients to inject relative path components or other traversal sequences, causing the application to resolve paths outside the intended workspace and inadvertently expose server-side files.

Potential impact

  • Exposure of application configuration files that may contain secrets or internal settings.
  • Disclosure of credentials, API keys, or tokens stored on disk.
  • Access to source code or internal scripts, aiding further exploitation or reverse engineering.
  • Leakage of server logs containing user data, system information, or error traces.
  • Discovery of system-level files that reveal OS details useful for subsequent attacks.

General mitigation guidance

Effective mitigation typically focuses on strictly constraining file access to a known-safe directory and removing trust in client-supplied path components.

Common defensive patterns include:

  • Resolving requested paths to canonical (absolute) form and verifying they stay within a predefined base directory before accessing the filesystem.
  • Enforcing allowlists of expected filenames or patterns instead of accepting arbitrary paths from clients.
  • Rejecting any input containing directory traversal sequences, absolute path indicators, or other filesystem metacharacters.
  • Separating public, user-accessible files from sensitive configuration or secrets so that even if traversal occurs, high-value data is not colocated.
  • Running the XAgent service under a dedicated, least-privileged account with minimal filesystem access rights.

How teams detect issues like this

Detection strategies for this class of issue often combine code inspection and runtime monitoring:

  • Static analysis: Search for file access functions where user input (such as filename) is concatenated into paths without normalization or boundary checks; look for patterns in workspace.py that build paths via simple string operations.
  • Code review: Flag any route or controller that accepts a filename or path parameter and verify it enforces a strict base directory and path validation; reviewers should be wary of ../ handling and absence of canonicalization.
  • Automated tools: Integrate security-focused linters or SAST tools that include rules for path traversal, especially around functions performing open, file reads, or directory listing, and correlate these with request parameters.
  • Operational signals: Monitor access logs for suspicious filename values containing traversal patterns or unexpected file extensions, and alert on repeated attempts to access sensitive known paths.

Sources

SourceLink
gist.github.comgist.github.com/jack2223333/f79f233b67d6506b9dd184399525cbf4

Frequently asked

questions

Exploitability depends on how the endpoint is exposed and whether access is authenticated, but any client that can reach the affected file() route and control the filename parameter may attempt path traversal to read server-side files.

Typically no local access is required; network access to the vulnerable endpoint is sufficient. In some deployments, an attacker may need valid credentials if the route is protected, but the underlying issue is independent of authentication.

The safest pattern is to constrain all file reads to a predefined base directory, canonicalize the requested path, and reject any path that resolves outside that directory. Where possible, avoid accepting arbitrary filenames and instead map client requests to a controlled set of resources.

Establish a standard pattern for file access that always performs path canonicalization, base directory checks, and strict validation of filename parameters; reinforce this with secure coding guidelines, code review checklists, and static analysis rules targeting path usage.

Find out what's already
exploitable in your codebase.