/

CVE-2026-26192

Severity:

HIGH RISK

(7.3)

XSS in Open WebUI Chat Citation Rendering

CVE-2026-26192

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to arbitrary JavaScript execution in users' browsers

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

A stored cross-site scripting (XSS) vulnerability in Open WebUI allows attacker-controlled document content to be rendered as HTML when citation previews are displayed.

By manipulating the html metadata property in chat history, an attacker can cause arbitrary script execution in users' browsers when they view affected chats or shared citations.

Affected context

The issue arises in Open WebUI's handling of chat history documents and their metadata.

When a document referenced in a chat contains metadata with html set, the frontend may treat its contents as trusted HTML and render them in an iframe during citation preview.

This becomes risky when chat history or document metadata can be modified by users or imported content without strict sanitization or validation, especially in multi-user or shared-chat scenarios.

Exploit preconditions

  • Attack surface: Web UI (browser-based chat interface and shared chat views)
  • Required access: Ability to create or modify chat history entries or associated document metadata, including setting the html property
  • Trigger point: Viewing a chat that includes a citation referencing a weaponized document, or opening a shared chat containing such a citation
  • Why exploitation is possible: The frontend follows a code path that interprets document contents as HTML based on the html metadata flag, and renders them without robust sanitization or isolation from the application's origin, allowing embedded JavaScript to execute in the context of the Open WebUI domain.

Why this happens

The underlying bug is a classic stored XSS condition where untrusted content is treated as trusted HTML.

The frontend uses a metadata flag (html) on documents to decide whether to render their contents as HTML in an iframe during citation preview.

Because this flag can be influenced through manual modification of chat history, and the resulting HTML content is not strictly sanitized or served from a strongly isolated origin, attacker-controlled script can execute in the user's browser.

This corresponds to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where data from a lower trust source is incorporated into a web page as active HTML/JavaScript without appropriate neutralization.

Potential impact

  • Execution of arbitrary JavaScript in the context of the Open WebUI origin
  • Theft or exfiltration of chat content, prompts, and AI responses
  • Impersonation of the victim within the web application (e.g., sending or modifying chats)
  • Manipulation of AI interactions, including prompt injection at the UI layer
  • Potential pivot to browser-based attacks (e.g., redirecting users, phishing overlays, keylogging within the application view)

General mitigation guidance

Effective mitigation focuses on treating document content and metadata as untrusted and minimizing any rendering as active HTML:

  • Avoid using simple boolean flags (like html) that cause untrusted content to be interpreted as raw HTML; prefer data-only formats (e.g., plain text or Markdown with a strict renderer).
  • Apply robust HTML sanitization on any content that might be rendered as HTML, stripping scripts, event handlers, and dangerous elements/attributes.
  • Serve rich content from a strongly isolated context (e.g., sandboxed iframes with restrictive attributes and, where viable, different origins) to limit what injected script can access.
  • Enforce strict validation on chat history and document metadata so that only expected, safe fields and values are permitted.
  • Follow a least-privilege model for client-side components, ensuring that UI script has minimal access to sensitive in-page objects and tokens, reducing the blast radius if XSS occurs.

How teams detect issues like this

High-level detection approaches can help identify and prevent similar XSS issues:

  • Static analysis: Search for code paths that render dynamic content as HTML (e.g., innerHTML, dangerouslySetInnerHTML, iframe srcdoc, or template injection) based on user-controlled metadata flags.
  • Code review: Flag any logic that switches from text rendering to HTML rendering using client-side flags or metadata fields that originate from stored data; verify sanitization, encoding, and sandboxing at these boundaries.
  • Security testing: Use automated and manual XSS probes in chat content, document uploads, and history import/export flows to validate that user-supplied content cannot become executable HTML.
  • Policy and tooling: Integrate secure coding guidelines into review checklists and optionally use SAST/DAST tools configured with rules for XSS patterns, particularly around iframe usage and HTML rendering shortcuts.

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/blob/6f1486ffd0cb288d0e21f41845361924e0d742b3/src/lib/components/chat/Messages/Citations/CitationModal.svelte#L163-L170
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-xc8p-9rr6-97r2

Frequently asked

questions

Exploitability depends on who can alter chat history or document metadata. In environments where multiple users can contribute or share chats, a malicious user can store a payload that later executes when others view the affected citations or shared chats.

In most realistic deployments, an attacker would need some level of access that allows them to create or modify chats or associated documents. Once a malicious payload is stored, it can impact any user who subsequently views the affected chat or shared citation.

The safest approach is to ensure that stored content—especially document bodies and metadata—are never rendered as raw HTML based solely on a data flag. Instead, enforce strict sanitization, or switch to text/Markdown rendering with a hardened renderer, and use sandboxed, least-privilege contexts when rich content must be displayed.

Adopt a default-escape mindset for all user-controlled data, avoid rendering arbitrary HTML from stored content, and add security checks into development workflows. During design and review, treat any feature that allows HTML rendering, iframes, or rich content previews as high risk and require explicit sanitization, encoding, and isolation before approval.

Find out what's already
exploitable in your codebase.