/

CVE-2026-26193

Severity:

HIGH RISK

(7.3)

Cross-Site Scripting (XSS) in Open WebUI Chat History

CVE-2026-26193

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting in Web UI

Severity:

HIGH RISK

(7.3)

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 versions prior to 0.6.44 contain a stored cross-site scripting (XSS) vulnerability where manually edited chat history can inject arbitrary content into an iframe embed.

Because the iframe is sandboxed with allow-scripts and allow-same-origin, and the configuration for disabling same-origin is ignored, attacker-controlled scripts can execute in the context of the Open WebUI origin when the chat or its shared link is viewed.

Affected context

This vulnerability affects Open WebUI deployments that:

  • Allow users (or administrators) to manually modify chat history data, including response message properties such as embeds
  • Render the embeds property inside an iframe element
  • Use an iframe sandbox configuration that includes allow-scripts and allow-same-origin

It becomes relevant when chat content, including modified history, is rendered in either the standard chat interface or a "shared" chat view that can be accessed via a shareable link by other users of the instance.

Exploit preconditions

  • Attack surface: Web UI rendering of chat messages and shared chat views.
  • Required access: Ability to modify chat history data, including setting the embeds property on a response message (e.g., via local storage, database access, or internal tools that allow manual editing).
  • Trigger point: Viewing of the affected chat or any shared link that renders the compromised message; the browser loads the embeds content into an iframe with a permissive sandbox.
  • Why exploitation is possible: The application loads untrusted, user-controlled embeds data into an iframe whose sandbox incorrectly allows both scripts and same-origin behavior, and it does not consistently honor the configuration option intended to restrict allow-same-origin. This combination permits attacker-supplied JavaScript to run with access to the Open WebUI origin.

Why this happens

The core issue is improper neutralization of user-controlled data before it is executed in a browser context, consistent with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

Conceptually, the application:

  • Treats the embeds property of a chat response as display content rather than untrusted input.
  • Injects that content into an iframe whose sandbox includes allow-scripts and allow-same-origin, effectively creating an execution environment with the same origin as the main application.
  • Ignores or overrides a configuration meant to control the allow-same-origin behavior, weakening the expected isolation model.

This pattern represents a failure to maintain strong separation between untrusted, user-editable content and the active scripting context of the web application, allowing code execution where only inert data should be handled.

Potential impact

  • Execution of arbitrary JavaScript in the context of the Open WebUI origin.
  • Theft or exfiltration of sensitive data accessible to the web application (e.g., session information, model outputs, chat contents).
  • Impersonation of the victim user by performing actions on their behalf within the application UI.
  • Persistence of malicious payloads in chat histories that affect any user who views the compromised chat or its shared link.
  • Potential pivot to attack other browser-integrated services (e.g., browser extensions or local resources) depending on the victim's environment.

General mitigation guidance

Effective mitigation focuses on treating all user-controllable data as untrusted and isolating it from active scripting contexts:

  • Constrain iFrame Capabilities:
  • Avoid combining allow-scripts with allow-same-origin for frames that can load user-controlled content.
  • Prefer a sandbox policy that either disallows scripts entirely, or ensures untrusted content is hosted on a distinct, locked-down origin (e.g., a separate domain or subdomain).
  • Validate and Sanitize Embed Data:
  • Apply strict allowlists for which properties and URLs can be used in embeds.
  • Reject or strip script-like constructs, JavaScript URLs, inline event handlers, and other active content from embed fields.
  • Honor Security Configuration by Default:
  • Ensure that configuration flags controlling iframe sandbox options are consistently enforced in code paths that render embeds.
  • Default configurations should favor the most restrictive safe behavior and require explicit opt-in for more permissive sandboxing.
  • Limit Manual Data Editing:
  • Restrict manual modification of chat history to trusted operators and log changes to detect misuse.
  • Where possible, expose only high-level administration APIs that enforce validation, rather than allowing arbitrary low-level data manipulation.
  • Apply Principle of Least Privilege in the Frontend:
  • Minimize the exposure of sensitive APIs to the rendering frame.
  • Avoid storing long-lived or highly privileged tokens in browser-accessible storage when possible.

How teams detect issues like this

Detection can focus on both code-level patterns and runtime behaviors:

  • Static Analysis & Code Scanning:
  • Flag uses of iframe elements where:
  • The sandbox attribute combines allow-scripts with allow-same-origin, and
  • The src or inner document is derived from user-controlled or modifiable data (such as embeds in chat messages).
  • Identify template or JSX patterns where raw, unsanitized content is assigned into HTML containers (e.g., dangerouslySetInnerHTML or direct DOM APIs).
  • Targeted Code Review:
  • Review all code paths that deserialize or load chat history or embed data, especially where "manual edit" or admin tooling exists.
  • Check alignment between security-related configuration options (e.g., "iframe Sandbox Allow Same Origin") and actual runtime behavior of iframe construction.
  • Runtime Monitoring & Logging:
  • Log when chats are exported, imported, or manually edited; look for unusual or scripted content in embed fields.
  • Implement Content Security Policy (CSP) reporting endpoints to surface script executions originating from unexpected locations.
  • Automated Tooling:
  • Use web security scanners or automated UI tests that attempt to inject benign script markers into chat message fields and detect whether they execute.
  • Integrate these checks into CI/CD pipelines to guard against regressions when modifying the chat rendering layer.

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/blob/6f1486ffd0cb288d0e21f41845361924e0d742b3/src/lib/components/chat/Messages/ResponseMessage.svelte#L689-L703
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-vjm7-m4xh-7wrc

Frequently asked

questions

Yes. Once a malicious embeds payload is stored in a chat, any user who opens that chat or a shared version of it in their browser can trigger the stored XSS without additional interaction if the payload is designed to execute on load.

The attacker must be able to manually modify chat history so that they can set the embeds property of a response message. In practice, this may involve access to local storage, backend data stores, or administrative interfaces that allow editing of stored chat content.

Ensure that user-controlled embed data is never rendered in a same-origin frame that allows scripts. Either fully sanitize and constrain embeds to inert content, or isolate their rendering in a locked-down, script-disabled or cross-origin iframe, and consistently apply configuration that limits iframe capabilities.

Design the UI with a clear trust boundary around all user-generated content, enforce strict output encoding and sandbox policies, avoid mixing allow-scripts and allow-same-origin for untrusted content, and integrate automated checks (static analysis, CSP reporting, and security tests) into the development lifecycle to detect XSS-prone patterns early.

Find out what's already
exploitable in your codebase.