/

CVE-2026-59221

Severity:

HIGH RISK

(7.7)

Path Traversal (CWE-22) in Open WebUI Terminal Proxy

CVE-2026-59221

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-918

Impact:

Unauthorized File and Resource Access via Proxy

Severity:

HIGH RISK

(7.7)

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 path traversal issue in the Open WebUI terminal proxy allows specially crafted, repeatedly percent-encoded paths to bypass normalization safeguards.

When exposed, this can let an attacker traverse directories on the upstream terminal server and potentially access unintended files or resources through the proxy.

Affected context

This vulnerability occurs in Open WebUI deployments that use the embedded terminal or terminal proxy feature.

The affected code path is the _sanitize_proxy_path function in backend/open_webui/routers/terminals.py, which attempts to normalize and sanitize user-supplied proxy paths before forwarding them to the upstream terminal server.

Instances are most at risk when the terminal endpoint is reachable by untrusted users and the proxied backend has access to sensitive filesystem locations or internal resources.

Exploit preconditions

  • Attack surface: HTTP(S) requests to the Open WebUI terminal proxy endpoint.
  • Required access: Ability to send crafted requests to the terminal feature (depending on configuration, this may require authentication).
  • Trigger point: Submission of a proxy path containing a directory traversal sequence encoded more times than the sanitizer decodes (e.g., nine-times percent-encoded ../).
  • Why exploitation is possible: The sanitizer decodes the path only a fixed number of times (eight), allowing over-encoded traversal sequences to survive normalization.

These sequences are then decoded and interpreted by the upstream terminal server, effectively bypassing the intended path traversal checks in the proxy.

Why this happens

The root cause is an incomplete normalization and validation strategy for user-controlled paths in a proxying context.

The _sanitize_proxy_path function assumes a bounded level of percent-encoding and only decodes the incoming path a fixed number of times before checking for traversal patterns such as ../.

Attackers can nest or repeat percent-encoding beyond that limit so that traversal sequences remain hidden during the proxy's validation but are later resolved by the downstream terminal server.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') and is closely related to CWE-918: Server-Side Request Forgery, as the proxy forwards attacker-controlled paths to an internal terminal service.

Conceptually, it illustrates the risk of performing path validation on partially decoded data while an upstream or downstream component performs additional decoding.

Potential impact

  • Access to files or directories on the terminal server that should not be reachable through the proxy.
  • Exposure of configuration files, logs, or other sensitive data accessible to the terminal backend.
  • Abusing the proxy to interact with internal resources via crafted paths and commands.
  • Potential pivoting into further attacks if sensitive information is disclosed (e.g., credentials, API tokens, environment variables).
  • Circumvention of intended path or directory restrictions configured in the Open WebUI terminal feature.

General mitigation guidance

Effective mitigation focuses on robust path normalization and strict boundary enforcement when proxying to backend services.

Common defensive patterns include:

  • Normalizing inputs to a canonical form after fully decoding all layers of encoding, then enforcing restrictions on that canonical path.
  • Using allowlist-based routing (e.g., mapping logical resource IDs to predefined filesystem locations) instead of allowing arbitrary user-specified paths.
  • Enforcing chroot-like or jailed environments for terminal backends so that even if traversal sequences slip through, they cannot escape a constrained directory.
  • Avoiding fixed-iteration decoding loops; instead, perform decoding until no more transformations occur, with conservative limits and validation at each step.
  • Applying least-privilege to the terminal backend process, limiting file system and network permissions to only what is strictly necessary.
  • Treating all proxy inputs as untrusted, even when they originate from authenticated sessions, and validating them accordingly.

How teams detect issues like this

Detection can rely on a combination of code-level and operational approaches:

  • Static analysis: Flag patterns where user input is decoded a fixed number of times, then used in file system paths or proxied requests. Rules can look for repeated calls to URL-decode functions followed by checks for ../ or similar sequences.
  • Code review: Pay attention to any proxy or routing layer that rewrites paths or forwards traffic to internal services. Look for incomplete normalization, partial decoding, or assumptions about maximum encoding depth.
  • Runtime monitoring: Inspect logs for suspicious proxy path patterns, such as repeated percent-encoded characters, excessive encoding depth, or attempts to access parent directories.
  • Security testing: Incorporate fuzzing and penetration tests that apply multi-layer encoding and traversal patterns to all path-accepting endpoints, particularly those that proxy to internal services.
  • Automated SAST or DAST tools can be configured with rules or test cases specifically targeting path traversal through over-encoding and proxy normalization logic.

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/commit/05098d25a58d03738e01c4e85e8852c3b4ad849c
github.comgithub.com/open-webui/open-webui/pull/26050
github.comgithub.com/open-webui/open-webui/releases/tag/v0.10.0
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-frvj-c5qp-xj4w

Frequently asked

questions

Yes, it can be remotely exploitable whenever the terminal proxy endpoint is accessible over the network.

Whether this is limited to authenticated users or open to the public depends on the specific Open WebUI deployment configuration.

The attacker needs the ability to send HTTP(S) requests to the vulnerable terminal proxy endpoint.

In many deployments, this may require an authenticated Open WebUI session, but in misconfigured or shared environments, broader access may be possible.

The safest approach is to perform full, canonical normalization of the requested path after decoding all layers of encoding, then enforce strict directory boundaries using allowlists or rooted paths.

Additionally, the proxy should avoid trusting the client-supplied path directly and, where possible, map user-visible identifiers to fixed, server-side locations.

Preventing similar issues involves adopting secure-by-default patterns for proxy and path handling:

  • Always treat encoded data as untrusted and normalize it before use.
  • Prefer logical identifiers over raw paths in APIs exposed to users.
  • Apply defense-in-depth by restricting backend permissions and using jailed environments.
  • Incorporate automated checks and security testing focused on path traversal and over-encoding techniques in the development pipeline.
Find out what's already
exploitable in your codebase.