CVE-2026-59224: Open WebUI: Terminal proxy forwards a spoofable, integrity-unbound user identity to the upstream (X-User-Id header and ws_terminal session_id query injection)

Published Jul 9, 2026
·
Updated

Summary

The terminal proxy in backend/openwebui/routers/terminals.py forwards the Open WebUI user's identity to the upstream terminal server / backend coordinator as an authorization claim, with no cryptographic binding to the session that produced it. The forwarded identity is attacker-influenceable on both proxy paths:

1. HTTP path (proxyterminal) sets headers['X-User-Id'] = user.id. Upstreams that trust X-User-Id as identity receive it unsigned, so an attacker who can reach the upstream by other means (directly, a compromised peer, SSRF) can spoof it. 2. WebSocket path (wsterminal) is exploitable through Open WebUI itself, with no "other means" required. It interpolates the path parameter sessionid directly into the upstream URL and then appends ?userid=<caller>:

python upstreamurl = f'{wsbase}/p/{policyid}/api/terminals/{sessionid}' upstreamurl += f'?{urllib.parse.urlencode({"userid": user.id})}'

sessionid is neither validated nor URL-encoded (the HTTP sibling runs sanitizeproxypath; this path runs nothing). An encoded ?/& smuggled through sessionid survives Open WebUI's single decode and is re-decoded by the upstream, injecting an attacker-chosen userid ahead of the appended one. Query parsing binds the first occurrence, so the backend coordinator resolves the spoofed user's terminal scope.

Technical Details

The forwarded terminal identity is a bearer-style authorization claim with no integrity binding, and on the WebSocket path it is additionally injectable because sessionid is concatenated into the URL without encoding or delimiter validation.

Impact

A normal authenticated user can make the terminal proxy present another user's identity to the upstream backend coordinator. On backend coordinator-backed (policyid) servers that scope terminal containers by userid, this reaches another user's terminal scope; combined with a known active session ID (for example a chat-scoped session ID surfaced through a shared chat), it allows attaching to that user's live PTY. The HTTP-path variant additionally allows identity spoofing at the upstream tier for any deployment whose upstream trusts X-User-Id.

Appendix: Affected code

- backend/openwebui/routers/terminals.py — proxyterminal sets headers['X-User-Id'] = user.id with no signature. - backend/openwebui/routers/terminals.py — wsterminal builds the upstream URL from an unvalidated, unencoded sessionid and appends userid as a query parameter, allowing query injection.

Appendix: Consolidation

Per the Report Handling policy, this consolidates independent reports of the same root cause (the forwarded terminal identity is spoofable / not integrity-bound) into the earliest filing:

- @smoke-wolf (earliest filing) — the X-User-Id HTTP-path identity is forwarded without integrity binding, spoofable where the upstream trusts the header. - @rexpository — the wsterminal sessionid query-injection vector, proving the forwarded userid is spoofable through the Open WebUI proxy itself, with no "reach the upstream by other means" precondition.

Appendix: Recommended fix

- Validate and URL-encode sessionid before building the upstream URL (urllib.parse.quote(sessionid, safe=""); reject ?, #, &, /, %, backslash, control characters). Build the query string with a URL builder so attacker-controlled path content cannot precede it. - Bind the forwarded identity instead of passing a raw userid / X-User-Id: emit a short-lived signed claim (for example HS256 over {uid, iat, aud:serverid} with a key shared only with the specific upstream) and verify it upstream.

Other sources

Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform. Prior to 0.10.0, backend/openwebui/routers/terminals.py built the wsterminal upstream URL from an unencoded sessionid and appended userid as a query parameter, allowing query injection to make the terminal backend resolve another user identity; the HTTP proxy path also forwarded X-User-Id as an integrity-unbound identity claim. This issue is fixed in version 0.10.0.

NVD

Affected Software

3 affected componentsFixes available
Open WebUI Open WebUI<0.10.0
openwebui Open WebUI<0.10.0
pip/open-webui<0.10.0
0.10.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/open-webui to a version that resolves this vulnerability.

    Fixed in 0.10.0
  2. Upgrade

    Upgrade open_webui to a version that resolves this vulnerability.

    Fixed in 0.10.0
  3. Configuration

    In proxy_terminal, do not set headers['X-User-Id'] = user.id without integrity binding. Instead emit a short-lived signed claim (e.g., HS256 over {uid, iat, aud:server_id}) shared only with the specific upstream and verify it upstream.

    Open WebUI terminal proxy (backend/open_webui/routers/terminals.py) X-User-Id identity forwarding = Signed, short-lived claim instead of raw user.id
  4. Configuration

    In ws_terminal, validate and URL-encode session_id before building the upstream URL using urllib.parse.quote(session_id, safe=""); reject '?', '#', '&', '/', '%', backslash, and control characters before interpolation into upstream_url.

    Open WebUI ws_terminal upstream URL builder (backend/open_webui/routers/terminals.py) session_id validation and encoding before interpolation into upstream URL = urllib.parse.quote(session_id, safe="") + reject delimiter/control characters
  5. Configuration

    Build the query string with a URL builder rather than interpolating session_id directly into upstream_url and then appending '?user_id=<caller>' so attacker-controlled path content cannot precede/alter the query parameters.

    Open WebUI ws_terminal upstream URL query construction (backend/open_webui/routers/terminals.py) Query-string construction order = URL builder (attacker-controlled session_id cannot precede appended query)

Event History

Jul 9, 2026
CVE Published
via MITRE·05:09 PM
Data Sourced
via MITRE·05:09 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 24, 2026
Advisory Published
via GitHub·08:49 PM
Data Sourced
via GitHub·08:49 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-59224?

CVE-2026-59224 has a severity rating of high, with a score of 8.

2

How do I fix CVE-2026-59224?

To fix CVE-2026-59224, upgrade to version 0.10.0 or later of Open WebUI.

3

What systems are affected by CVE-2026-59224?

CVE-2026-59224 affects versions of Open WebUI prior to 0.10.0.

4

What type of vulnerabilities does CVE-2026-59224 represent?

CVE-2026-59224 represents a query injection vulnerability allowing spoofable user identities.

5

What can happen if CVE-2026-59224 is exploited?

If exploited, CVE-2026-59224 can lead to unauthorized user access and compromised system integrity.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203