/

CVE-2026-87995

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in Open WebUI Terminal Preview

CVE-2026-87995

Analyzed

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79, CWE-1021

Impact:

Account Takeover

Severity:

HIGH RISK

(8.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

Open WebUI rendered content from previewed terminal ports in a same-origin iframe sandbox that permitted both scripts and same-origin access. An authenticated user with access to a shared terminal server could host malicious script that may execute when another user opens the preview, potentially leading to account takeover.

Affected context

The vulnerability occurs in Open WebUI deployments that provide terminal port previews and render the proxied content through the chat file navigation interface. Risk exists when an attacker can access a shared terminal server, publish content on a previewed port, and cause or persuade another authenticated user to open that preview while the content remains associated with the Open WebUI origin.

Exploit preconditions

  • Attack surface: Terminal port preview functionality in the Open WebUI web interface
  • Required access: Authenticated access to a shared terminal server or another capability that allows hosting content on a previewed port
  • Victim condition: A second authenticated user must open the affected terminal preview
  • Trigger point: Rendering the terminal port content inside the preview iframe
  • Why exploitation is possible: The iframe permits both script execution and same-origin access while the proxied content is served from the Open WebUI origin

Why this happens

The underlying issue is an unsafe combination of iframe sandbox permissions for untrusted, attacker-influenced content. Allowing both allow-scripts and allow-same-origin can weaken the isolation expected from a sandbox, particularly when the framed resource is served under the same origin as the parent application. This maps primarily to CWE-79: Improper Neutralization of Input During Web Page Generation, because attacker-controlled content can execute script in a trusted application context, and also relates to CWE-1021: Improper Restriction of Rendered UI Layers or Frames.

Potential impact

  • A malicious script may execute in the victim's browser context
  • An attacker could potentially access or modify account-associated application data
  • Victim sessions or account functionality may be compromised
  • Other users of shared terminal infrastructure could be targeted through crafted previews
  • The issue could facilitate unauthorized actions performed through the victim's active session

General mitigation guidance

Mitigation generally focuses on isolating previewed content from the application trust boundary and preventing attacker-controlled markup from executing with application privileges.

Common defensive patterns include:

  • Serve terminal previews from a distinct, non-privileged origin
  • Avoid combining allow-scripts and allow-same-origin for untrusted framed content
  • Apply the narrowest iframe sandbox permissions required by the feature
  • Use restrictive Content Security Policy controls for preview responses
  • Treat shared terminal output and hosted content as untrusted input
  • Enforce output encoding and content-type controls where HTML rendering is not required
  • Ensure session cookies and privileged browser APIs are not exposed to preview origins
  • Apply authorization checks and least privilege to shared terminal resources

How teams detect issues like this

Organizations can assess for this class of issue through:

  • Static analysis and code review rules for iframe elements that combine script execution with same-origin access
  • Inventory of endpoints that proxy or render user-controlled content under a trusted application origin
  • Browser security testing that verifies preview content cannot access parent application data
  • Policy checks for cross-origin isolation, restrictive sandbox attributes, and preview-specific Content Security Policy headers
  • Dynamic tests using benign marker content to confirm that scripts in previews cannot execute with application-origin privileges
  • Automated security review tools that flag unsafe iframe configurations and reflected or stored script execution paths

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/commit/54d7a223707f03172efbb9e754db6e69709956d0
github.comgithub.com/open-webui/open-webui/releases/tag/v0.11.1
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-jmc6-2wr8-h3wj

Frequently asked

questions

Exploitation generally requires authenticated access to a shared terminal server or another permitted method of publishing content on a previewed port. The exact scope depends on deployment access controls.

A victim must open a terminal port preview containing attacker-controlled content. The preview's origin and sandbox configuration then determine whether the content can interact with the Open WebUI application.

Isolate previewed content on a separate, untrusted origin and use a restrictive iframe sandbox that does not grant unnecessary script or same-origin capabilities.

Treat proxied terminal content as untrusted, review iframe permissions during code review, enforce browser security policies, and test that preview content cannot access authenticated application state.

Find out what's already
exploitable in your codebase.