/

CVE-2026-70492

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in Open WebUI KaTeX Rendering

CVE-2026-70492

Analyzed

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-Side Code Execution and Account Compromise

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 can store a chat message containing malformed mathematical markup that causes KaTeX rendering to fail and triggers an unsafe HTML fallback. When another user views the affected message, including through shared chats or channels, embedded script may execute in their browser and expose session data or enable account takeover.

Affected context

The vulnerability occurs in Open WebUI deployments that render persisted chat content through the KaTeX renderer and use an HTML-injection fallback after a rendering exception. It becomes risky when untrusted users can submit or share messages that are later viewed by other users, especially administrators, in chats or channels.

Exploit preconditions

  • Attack surface: Browser-based rendering of stored chat messages, shared chats, or channel content
  • Required access: Ability to submit or influence a message that other users may view
  • Trigger point: Rendering of malformed math content that causes KaTeX to fail and enter the fallback path
  • Why exploitation is possible: The fallback inserts attacker-controlled source as HTML instead of treating it as text, allowing browser-executable content to run in the viewer's session

Why this happens

The underlying issue is a stored cross-site scripting flaw mapped to CWE-79: Improper Neutralization of Input During Web Page Generation. When KaTeX encounters a failure condition, the error-handling path renders the original math source through an HTML sink without adequate escaping or sanitization. This converts content that should remain inert text into browser-interpreted markup.

Potential impact

  • A viewer's browser session data may be exposed
  • Authentication tokens stored in the browser may be stolen
  • An administrator account could be taken over
  • Actions may be performed in the context of an affected viewer
  • Shared chats or channels may distribute the malicious content to additional users
  • The integrity and confidentiality of application data may be compromised

General mitigation guidance

Mitigation should focus on maintaining a strict text-only trust boundary for user-generated mathematical content and all error paths.

Common defensive patterns include:

  • Escape untrusted content before inserting it into the document
  • Prefer text-node or framework-safe rendering APIs over raw HTML sinks
  • Apply narrowly scoped sanitization when rich rendering is required
  • Ensure exception and fallback paths enforce the same output-encoding policy as normal paths
  • Limit the privileges and accessible data associated with browser sessions
  • Use secure cookie and token-handling policies where feasible, reducing reliance on script-accessible session storage
  • Apply the vendor-provided security correction through the organization's normal patch process

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying raw HTML rendering APIs such as Svelte's {@html} with user-controlled data
  • Code review checks covering parser exceptions, fallback renderers, and alternate output paths
  • Taint analysis tracing chat content into DOM or HTML sinks without contextual encoding
  • Policy enforcement that prohibits unsanitized HTML insertion in message-rendering components
  • Browser security controls and monitoring for unexpected script execution or access to client-side session storage
  • Regression tests using malformed markup and adversarial content across both normal and error-rendering paths

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/commit/bc600d3f085802c45aa8f38c30e6e8c986bde6cc
github.comgithub.com/open-webui/open-webui/pull/26718
github.comgithub.com/open-webui/open-webui/releases/tag/v0.11.0
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-pwxh-7358-jq2x

Frequently asked

questions

It can be exploited through the application's normal web interface when an attacker can submit or influence content that another user later views. Direct network access to the victim's browser is not required.

No. A lower-privileged user who can create or share messages may be able to target other viewers. An administrator viewing the content could face greater impact because their session may have broader privileges.

Treat all chat and math content as untrusted, render it as text or through a narrowly controlled sanitizer, and ensure every error and fallback path applies the same escaping rules.

Review all raw HTML sinks, add security tests for parser failures and fallback behavior, enforce output-encoding policies in code review and CI, and minimize the privileges and exposure of browser-held session credentials.

Find out what's already
exploitable in your codebase.