NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Open WebUI

CVE-2026-70486: Open WebUI: Same-origin XSS to account takeover via terminal file-preview iframe hardcoding allow-same-origin

highCVSS 3.1 8.2GHSA-3xpf-xq7r-v8c5

Open WebUI 0.9.0 through 0.10.2 runs HTML files from a terminal server in a preview iframe that always allows same-origin access, so script in the file can steal the viewer's session token and take over the account. It only applies when an admin has configured a terminal server. Upgrade to 0.11.0.

Published Aug 4, 2026 · Analysis Oct 25, 2026

What an attacker can do

The preview component src/lib/components/chat/FileNav/FilePreview.svelte has two paths. The srcdoc path was hardened: same-origin is opt-in through the iframeSandboxAllowSameOrigin user setting and a CSP is injected. The later serveUrl path, used for files served through /api/v1/terminals/{id}/files/serve/..., kept a fixed sandbox string with both allow-scripts and allow-same-origin. The terminal proxy sits on the application's own origin and adds no CSP by default, so the sandbox was the only boundary, and it granted the permission that removes it.

An attacker with a normal account on a terminal server writes an HTML file whose script reads window.parent.localStorage.token. When a display_file tool call shows the file, the chat opens the preview with no click, and the token leaves. The victim needs only an open chat.

The attacker still has to get the file written and displayed, through prompt injection or a social step, which is why complexity is rated high. If the victim is an admin or has workspace.functions, the takeover extends to server-side code execution through Functions. Without a configured TERMINAL_SERVER_CONNECTIONS, nothing is exposed.

Who is affected

Open WebUI >= 0.9.0, <= 0.10.2, where the serveUrl branch exists, and only with at least one terminal server configured (TERMINAL_SERVER_CONNECTIONS, empty by default). Setting a restrictive Content-Security-Policy through TERMINAL_PROXY_HEADERS also protected operators. Check the version:

pip show open-webui

open-webui

Ecosystem
PyPI
Affected
>= 0.9.0, <= 0.10.2
Fixed in
0.11.0
Check
pip show open-webui

How to fix it

Upgrade to 0.11.0:

pip install --upgrade open-webui==0.11.0

Pull request 26907 (commit 65a5fad7b) gates allow-same-origin on the iframeSandboxAllowSameOrigin setting for the serveUrl branch, so the preview loads at an opaque origin by default. No configuration change is needed and HTML previews still render. The sources list no other workaround, though a restrictive CSP in TERMINAL_PROXY_HEADERS was noted as protective.

How to tell if you were hit

Review the files on your terminal servers for HTML that references window.parent, localStorage or outbound fetches, especially files recently written by non-admin users or by an agent session. Check proxy logs for /api/v1/terminals/{id}/files/serve/ requests followed by unexpected outbound calls from user browsers. Treat a session token as exposed if such a file was previewed, and sign the user out.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

Any authenticated user with access to a terminal server could get script of their choosing to run in the Open WebUI origin itself. The HTML file preview rendered terminal-served files in an iframe whose sandbox always granted allow-same-origin alongside allow-scripts, and the file is served from a path on the application's own origin, so the sandbox provided no isolation at all. Script in a previewed file could read the victim's session token and take over the account.

Preconditions

  • At least one terminal server configured by an admin (TERMINAL_SERVER_CONNECTIONS, empty by default) and reachable by the victim. Deployments with no terminal server configured are not affected.
  • The attacker needs a normal authenticated account with access to that terminal server, no admin rights.
  • No victim interaction beyond having the chat open: a display_file tool call opens the preview automatically.
  • TERMINAL_PROXY_HEADERS unset, which is the default. An operator who had already set a restrictive Content-Security-Policy through it was not exposed, since those headers are merged into every proxied response including the served file.
  • The iframeSandboxAllowSameOrigin user setting is off by default, but the affected branch ignored it entirely.

Impact

The previewed document runs in the application origin, so it can reach the parent window, read the session token out of localStorage and exfiltrate it, which is full account takeover of the victim. If the victim is an admin, or any user holding workspace.functions, that takeover extends to server-side code execution through Functions. Getting the malicious file written and displayed still requires a prompt-injection or a social step, which is what keeps the complexity high rather than trivial. Instances with no terminal server configured were never affected, and neither was the srcdoc preview path.

Fix

Fixed in 0.11.0 by 65a5fad7b (#26907). The serveUrl preview branch now gates allow-same-origin behind the same iframeSandboxAllowSameOrigin setting the srcdoc branch already used, so by default the preview loads at an opaque origin and cannot reach the parent context. Upgrading is sufficient, no configuration change is required, and HTML previews continue to render normally.

Root cause

  • src/lib/components/chat/FileNav/FilePreview.svelte, the serveUrl iframe branch, reached for HTML files served through /api/v1/terminals/{id}/files/serve/....
  • Present from 0.9.0, where that branch was introduced, through 0.10.2.

The component grew two preview paths. The srcdoc path was hardened: same-origin became opt-in and a CSP was injected into the document. The serveUrl path, added later for files streamed from a terminal server, kept a static sandbox string with allow-same-origin baked into it. Because the terminal proxy is mounted under the application's own origin and forwards the upstream response without adding a Content-Security-Policy of its own unless the operator configured one, and no global CSP is set, the sandbox was the only isolation boundary left, and it was granting precisely the permission that dissolved it.

Proof of concept

Write an HTML file containing a script that reads window.parent.localStorage.token to a terminal server the victim can reach, then trigger display_file for that file. The chat handler opens the preview on the resulting terminal:display_file event with no click, the script executes at the application origin, and the token is exfiltrated.

Credits

Reported by @manus-use (researcher zx / Jace).

Credited to manus-use, Classic298.

Questions

Is my Open WebUI affected if I have no terminal server?

No. The advisory says deployments with no terminal server configured are not affected, and neither is the srcdoc preview path.

Does the victim have to click anything?

No. A display_file tool call opens the preview automatically, so the victim only needs the chat open. The attacker does need a way to get the malicious file written and displayed.

How bad is it if the victim is an admin?

The attacker gets the admin session. For an admin, or anyone with workspace.functions, this extends to server-side code execution through Functions.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Open WebUI vulnerabilities

All Open WebUI entries