/

CVE-2026-45303

Severity:

HIGH RISK

(7.7)

Cross-Site Scripting (XSS) in Open WebUI HTML Chat Renderer

CVE-2026-45303

Modified

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Client-Side Code Execution and Session/Context Compromise

Severity:

HIGH RISK

(7.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's HTML rendering view allows injected scripts to execute within an iframe that is configured with permissive sandbox attributes, effectively bypassing intended isolation.

When untrusted chat content is rendered as HTML with script execution and same-origin access enabled, an attacker-controlled script can run in the user's browser and interact with parent context data such as local storage.

Affected context

This vulnerability arises in Open WebUI installations that:

  • Use the HTML rendering view to visualize chat content in the browser
  • Embed that content inside an iframe using a sandbox attribute that still permits allow-scripts, allow-forms, and allow-same-origin
  • Render user- or model-generated content without fully neutralizing active scripting capabilities

The issue primarily affects browser clients viewing chats in environments where content may include untrusted or semi-trusted HTML fragments.

Exploit preconditions

  • Attack surface: Web UI in the browser, via the HTML chat visualization feature.
  • Required access: Ability to inject or influence chat content that is later rendered in the HTML view (e.g., via user input, shared prompts, or data imported into the chat).
  • Trigger point: A victim user opens or previews the affected chat using the HTML rendering view, causing the browser to load the iframe containing the malicious HTML.
  • Why exploitation is possible: The iframe's sandbox configuration includes allow-scripts and allow-same-origin, which undermines isolation and permits the injected script to execute and interact with the parent origin context.

Why this happens

The root cause is a classic Cross-Site Scripting (XSS) pattern where untrusted content is rendered as active HTML/JavaScript without sufficient neutralization or isolation.

Although the content is placed in a sandboxed iframe, the inclusion of allow-scripts and allow-same-origin reintroduces most of the privileges that the sandbox was meant to restrict.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, as the application assumes that the iframe sandbox alone provides adequate protection while still allowing script execution from untrusted content.

Potential impact

  • Script execution in the context of the Open WebUI origin.
  • Access to browser storage associated with the application (e.g., local storage, if exposed via same-origin).
  • Impersonation of user actions within the UI, including sending prompts or modifying settings visible in the web interface.
  • Exfiltration of sensitive information accessible from the client-side context, such as stored tokens or configuration data.
  • Persistent or semi-persistent XSS if the malicious HTML remains associated with saved chats or shared content.

General mitigation guidance

Mitigation generally involves reducing the trust placed in rendered HTML content and tightening client-side isolation:

  • Prefer rendering chat content as plain text or using robust HTML sanitization that removes or neutralizes scripts, event handlers, and dangerous attributes before display.
  • Avoid enabling allow-scripts and allow-same-origin on iframes that contain untrusted or user-controlled content; use a stricter sandbox policy that prevents script execution and blocks access to the parent origin.
  • Apply a default-deny approach for active content in the UI, only whitelisting minimal, well-audited functionality when absolutely necessary.
  • Segment sensitive client-side data (such as tokens or configuration) so that it is not accessible to potentially compromised UI components, and ensure least-privilege access even within the browser.
  • Encourage architectural patterns where potentially unsafe visualizations are hosted on separate origins or subdomains with no access to core application state.

How teams detect issues like this

Detection can focus on both code-level and behavior-level indicators:

  • Static analysis and code review:
  • Flag uses of innerHTML, dangerouslySetInnerHTML, or similar APIs that insert raw HTML derived from user or model content.
  • Identify iframe sandbox attributes that include allow-scripts and allow-same-origin for content that is not strictly trusted.
  • Review components responsible for rendering chat history, exports, or previews to ensure they either sanitize content or enforce strong isolation.
  • Policy enforcement:
  • Apply security linting rules in CI to prevent introduction of script-enabled iframes or unsanitized HTML rendering paths.
  • Use Content Security Policy (CSP) to limit inline script execution and restrict script sources where feasible.
  • Runtime monitoring:
  • Monitor the application for unexpected script execution paths or DOM modifications originating from content areas intended to be passive.

Automated code scanning tools, browser-based security tests, and targeted penetration tests focusing on the HTML visualization feature can help discover similar issues.

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-4vrc-m9ch-6m3r

Frequently asked

questions

Exploitability depends on who can influence the chat content.

If untrusted users or external sources can contribute content that is later rendered in the HTML view, then any user who opens that view may trigger the malicious script.

An attacker typically needs the ability to create or modify chat content that will be rendered using the HTML visualization.

They do not need direct access to the server; exploitation occurs in the victim's browser when they load the affected view.

The safest pattern is to treat all chat content as untrusted:

  • Render it as plain text wherever possible.
  • If HTML rendering is required, perform strict sanitization to remove scripts and dangerous attributes, and avoid iframe configurations that permit script execution from untrusted sources.

Prevention strategies include:

  • Adopting a consistent output encoding and sanitization strategy for all user- and model-generated content.
  • Establishing UI guidelines that prohibit allow-scripts and allow-same-origin on iframes rendering untrusted content.
  • Integrating security-focused code review and automated checks into the development pipeline, particularly around new visualization or embedding features.
Find out what's already
exploitable in your codebase.