Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to Open WebUI
-
DeliveryUpload malicious Markdown with Mermaid click directive
-
ExploitLure victim to open file preview
-
ExecutionVictim clicks rendered diagram node
-
Persistjavascript: URI fires under app origin
-
ImpactSteal session or perform CSRF actions
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 | Exploitation requires (1) an Open WebUI instance running a vulnerable version (≤ 0.9.5) where Mermaid is initialized with securityLevel:'loose', (2) an attacker holding low-privileged credentials sufficient to start a chat and upload files with Code Interpreter enabled, (3) a victim user who subsequently opens the malicious .md attachment in the file preview panel AND clicks the rendered Mermaid node containing the javascript: href, and (4) absence of a restrictive Content Security Policy blocking javascript: URIs. Exploitation is limited by the required victim interaction (UI:R - both opening the preview and clicking the diagram element), the need for an authenticated upload session, and the fact that single-tenant or solo deployments offer no cross-user victim to target. |
| Impact | The CVSS 3.1 vector AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N reflects a network-reachable, low-complexity attack that requires a low-privileged uploader and a victim interaction (opening the file and clicking the diagram), with a scope change because script runs in the victim's browser under the Open WebUI origin rather than the uploader's session. EPSS, KEV, and SSVC data were not provided, so probabilistic exploitation likelihood and automatability cannot be quantified, but a working PoC is published in the GHSA advisory, making exploitation trivially reproducible in any unpatched deployment that allows file uploads. Real-world risk is meaningful in multi-tenant Open WebUI instances (shared workspaces, hosted deployments) where a low-privileged attacker can target admins or other users; in single-user/local-only deployments the practical risk is lower. The 8.7 score is consistent with the scope-changed XSS impact, though UI:R and PR:L should temper urgency relative to a pre-auth RCE. |
| Exploit ScenarioDerived | An attacker with a low-privileged Open WebUI account creates a chat, enables Code Interpreter, and uploads a .md file containing a Mermaid flowchart whose click directive points to a javascript: URI; the file persists in the workspace. When an administrator or another user opens the file preview and clicks the rendered node, arbitrary JavaScript executes in their browser under the Open WebUI origin, enabling session token theft, CSRF against admin endpoints, or pivot into account takeover. A working PoC payload is published in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 18, 2026
Stored cross-site scripting in Open WebUI up to and including v0.9.5 allows authenticated users to execute arbitrary JavaScript in another user's browser under the application origin by uploading a malicious Markdown file containing a crafted Mermaid diagram. The flaw stems from Mermaid being initialized with securityLevel:'loose' and its SVG output being injected via innerHTML in the file preview panel. Publicly available exploit code exists in the GHSA advisory, but there is no public exploit identified at time of analysis beyond the PoC, and the issue is not listed in CISA KEV.
RemediationAI
Upgrade Open WebUI to version 0.9.6 or later (Vendor-released patch: 0.9.6), available via pip install --upgrade open-webui and tracked at https://github.com/open-webui/open-webui/security/advisories/GHSA-v8qj-hxv7-mgvv; the underlying fix changes Mermaid initialization from securityLevel:'loose' to 'strict' so Mermaid's built-in DOMPurify sanitizes output. Where immediate patching is not possible, restrict Markdown/file uploads to trusted users, disable the Code Interpreter file-preview feature, or front the application with a Content Security Policy that forbids inline event handlers and javascript: URIs - noting that a strict CSP may break other Open WebUI rendering features and that limiting uploads reduces collaborative functionality.
Affected VersionsENISA
Affected Packages
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 (pip package open-webui) is a self-hosted web interface for LLMs written in Svelte/TypeScript. It uses the Mermaid diagram library to render flowcharts embedded in Markdown via fenced `mermaid code blocks. In src/lib/utils/index.ts the application calls mermaid.initialize with securityLevel:'loose', which disables Mermaid's built-in DOMPurify sanitization and permits javascript: URIs in click directives. The rendered SVG is then inserted into the DOM with innerHTML in src/lib/components/chat/FileNav/FilePreview.svelte, propagating the unsafe link into a live, clickable element under the Open WebUI origin. The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation), specifically a sink-side trust failure where attacker-controlled diagram syntax is treated as trusted markup.
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
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Network-reachable upload requires a low-privileged account (PR:L) and victim click (UI:R); script runs under app origin affecting another user (S:C) with high C/I impact and no availability effect.
Primary rating from Vendor (https://github.com/open-webui/open-webui).
CVSS VectorNVD
Lifecycle Timeline
2DescriptionNVD
Summary
Open WebUI renders Mermaid blocks from Markdown files in the file preview panel and inserts the generated SVG into the DOM using innerHTML.
Because Mermaid is configured with securityLevel: 'loose', attacker-controlled Mermaid content can be rendered unsafely in this flow. A working payload was validated through the Markdown preview path, resulting in JavaScript execution in the victim’s browser under the application origin.
This is a confirmed stored XSS vulnerability reachable through normal product functionality.
Affected Version
main- Reproduced on
v0.8.12
Affected Code
Mermaid is initialized in permissive mode:
https://github.com/open-webui/open-webui/blob/9bd84258d09eefe7bf975878fb0e31a5dadfe0f8/src/lib/utils/index.ts#L1698 The file preview path renders Mermaid output and injects the returned SVG into the DOM:
https://github.com/open-webui/open-webui/blob/9bd84258d09eefe7bf975878fb0e31a5dadfe0f8/src/lib/components/chat/FileNav/FilePreview.svelte#L133
Impact
A successful exploit allows JavaScript execution in the victim’s browser under the Open WebUI origin when a malicious Markdown file is opened in the preview panel.
PoC
A malicious .md file containing the follwowing contents can be used to trigger the bug:
flowchart LR A[click me] click A href "javascript:alert(document.domain)" "x"
Steps to reproduce: 1- Create a new chat 2- Enable Code Interpreter and browse and upload the file with .md extension. <img width="331" height="258" alt="image" src="https://github.com/user-attachments/assets/bce2b754-56d1-4da1-90a9-22bcb93269f2" /> 3- Clicking on the file, and clicking click me should pop an alert <img width="1103" height="485" alt="image" src="https://github.com/user-attachments/assets/18754486-799b-434e-a2fc-dd7c09956a29" />
Remediation
Since mermaid has DOMPurify as a built-in, it is recommended to use the strict mode instead of loose.
Executive ViewAI
Open WebUI versions 0.9.5 and earlier contain a stored cross-site scripting vulnerability with publicly available exploit code. Authenticated users can inject malicious code into file previews to execute arbitrary JavaScript in colleagues' browsers, enabling session hijacking, credential theft, and unauthorized access to shared resources. Organizations using affected versions face immediate compromise risk.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) disable Markdown file uploads or restrict to administrative users only; (2) disable Mermaid diagram rendering in file preview functionality; (3) implement strict Content Security Policy headers to block inline script execution; (4) enforce comprehensive file content validation and sanitization; (5) disable file preview feature entirely until patch confirmation.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
EUVD-2026-38531
GHSA-v8qj-hxv7-mgvv
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB