Summary
Open WebUI's terminal-server reverse proxy insufficiently sanitizes a user-controlled path segment before forwarding it to an admin-configured terminal server.
An authenticated user with terminal access can craft encoded traversal sequences to escape the intended path scope, potentially accessing unintended endpoints, files, or internal services the terminal server can reach.
Affected context
This vulnerability arises in Open WebUI deployments that expose the terminal-server reverse proxy in backend/open_webui/routers/terminals.py to authenticated users who have been granted access to at least one terminal server.
The issue manifests when the proxy forwards a user-supplied path to a terminal backend without robust normalization and validation of traversal sequences.
Environments where the terminal server can reach local files, privileged endpoints, or additional internal services are at elevated risk.
Exploit preconditions
- Attack surface: HTTP(S) requests sent to the Open WebUI terminal-server reverse proxy endpoint.
- Required access: Authenticated Open WebUI account with permission to use at least one configured terminal server.
- Trigger point: Supplying crafted
pathvalues, including encoded or double-encoded../sequences, in requests routed through the terminal proxy. - Why exploitation is possible: The proxy relies on incomplete path sanitization that does not fully normalize or reject traversal sequences (including double-encoded dots) before forwarding to the terminal server, allowing the effective request path to escape the intended scope.
Why this happens
The root cause is incomplete normalization and validation of a user-controlled URL path before it is forwarded by a reverse proxy component.
The code path attempts to confine requests but fails to correctly canonicalize and re-validate encoded traversal patterns (including %2e%2e and %252e%252e), allowing directory traversal relative to the terminal server's base.
This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory for escaping an intended directory or policy boundary, and CWE-918: Server-Side Request Forgery (SSRF) where the proxy can be abused to reach internal services or unexpected endpoints accessible from the terminal backend.
Potential impact
- Unauthorized access to files or endpoints on the terminal-server host that should not be reachable via the proxy
- SSRF-style access to internal services that the terminal server can communicate with
- Bypassing application-level access controls enforced only at the proxy layer
- Discovery of internal network structure and services reachable from the terminal backend
- Potential chaining with other vulnerabilities on internal targets for further compromise
General mitigation guidance
Effective mitigation focuses on strict path canonicalization and explicit allowlisting of reachable resources.
Common defensive patterns include:
- Normalizing and resolving paths server-side before forwarding, then validating that the resolved path remains within an explicitly allowed base directory or prefix.
- Rejecting or strictly constraining any use of
..segments, including encoded and double-encoded variants, and failing closed on malformed encodings. - Treating user-supplied proxy paths as opaque, and instead mapping user actions to predefined, server-side route templates or resources.
- Applying defense-in-depth on terminal servers by limiting which internal hosts, ports, and files they can access, and by running them with least-privilege accounts and minimal filesystem exposure.
- Segmenting internal services behind network policies or firewalls so that even if the proxy is misused, reachable targets are minimized.
How teams detect issues like this
Detection typically combines code-focused and runtime monitoring approaches:
- Static analysis rules that flag reverse-proxy logic where user-controlled path components are concatenated, joined, or forwarded without rigorous normalization and boundary checks.
- Code review checklists that specifically inspect proxy / gateway components for path traversal protections, canonicalization steps, and strict allowlists rather than blacklist-style checks.
- Logging and monitoring of terminal-proxy requests, alerting on suspicious patterns such as
../, encoded traversal sequences, or unusually deep path hierarchies. - Web application firewalls or API gateways configured with rules to block traversal-like sequences and anomalous encodings in proxy-targeted paths.
- Periodic security testing focused on proxy endpoints, including fuzzing encoded and double-encoded path segments to verify that traversal attempts are blocked.

