Summary
Open WebUI versions prior to 0.8.0 contain a cross-site scripting vulnerability in the Excel (XLSX) preview feature that allows attacker-controlled content to be rendered as executable HTML/JavaScript.
When a crafted XLSX file is processed, malicious content generated by SheetJS is inserted into the DOM without sanitization, enabling arbitrary script execution in the user's browser under certain conditions.
Affected context
This vulnerability affects Open WebUI deployments that:
- Allow users or integrated systems to upload or attach Excel (XLSX) files
- Automatically generate HTML previews of XLSX files using SheetJS (e.g.,
sheet_to_html) - Insert the resulting HTML into the application's DOM via templating constructs like
@htmlor similarly privileged sinks
The risk is most relevant in multi-user or shared environments where one user can upload content that another user will preview within the Open WebUI interface.
Exploit preconditions
- Attack surface: Web UI, specifically the XLSX file preview functionality
- Required access: Ability to upload or otherwise supply a crafted XLSX file that will be previewed by another user
- Trigger point: User opens or previews the malicious XLSX attachment in the Open WebUI interface, causing the file to be processed by SheetJS and rendered into the DOM
- Why exploitation is possible: The HTML produced by
sheet_to_htmlis treated as trusted and injected directly into the DOM via@htmlwithout sanitization, allowing embedded scripts or event handlers to execute in the victim's browser context
Why this happens
The root cause is a failure to neutralize untrusted data before including it in a web page, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).
The application uses SheetJS's sheet_to_html output as if it were inherently safe, and passes this HTML directly into a powerful rendering sink (@html) that bypasses normal escaping. Because the XLSX content can be attacker-controlled, the resulting HTML may contain script-capable constructs (e.g., event handlers, inline JavaScript) that the browser executes. The underlying pattern is mixing untrusted content with HTML rendering primitives without applying a robust HTML/DOM sanitization step or restricting the content to inert, data-only representations.
Potential impact
- Malicious JavaScript execution in the context of the Open WebUI origin
- Theft or exposure of user data accessible within the web session (e.g., tokens, configuration details, AI interaction history)
- Session hijacking or impersonation of affected users where session mechanisms are present
- Unauthorized UI actions performed on behalf of the victim through script-driven interactions
- Pivoting to further client-side attacks, such as injecting misleading UI content or phishing forms within the application
General mitigation guidance
Effective mitigation focuses on treating all file-derived content as untrusted and constraining how it is rendered in the browser:
- Prefer data-only rendering paths for spreadsheet previews that convert cells into inert text or structured data without reusing HTML capable of executing script.
- Introduce robust HTML sanitization before passing any external or file-derived HTML to privileged sinks like
@html, ensuring removal of scripts, event handlers, inline styles, and dangerous attributes or tags. - Apply contextual output encoding where possible, outputting spreadsheet content as text within templates that escape HTML by default instead of injecting raw HTML.
- Limit the trusted surface of the preview component, for example by rendering previews inside isolated contexts (such as sandboxed iframes) with restrictive CSPs to reduce the impact if sanitization gaps occur.
- Reinforce architectural patterns that separate untrusted content from core UI, avoiding direct DOM insertion of content derived from user-supplied files.
How teams detect issues like this
Organizations can identify similar vulnerabilities and regressions through a combination of review and automation:
- Static analysis and linters configured to flag uses of dangerous template primitives (e.g.,
@html,innerHTML,dangerouslySetInnerHTML) where the source data can be influenced by users or uploaded files. - Code review checklists that explicitly require scrutiny whenever new file preview or HTML rendering features are added, ensuring sanitization and encoding steps are present.
- Security-focused unit and integration tests that feed crafted XLSX or HTML-like content through preview pipelines and validate that scripting does not execute and markup is inert.
- Content Security Policy (CSP) monitoring, where available, to detect and log attempts to execute inline scripts or unauthorized resources, helping surface unexpected script execution paths.
- Optional use of automated SAST/DAST tools to scan for and exercise XSS sinks in web components, especially around file-handling functionality.

