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
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)
Upload the file to Open WebUI via the chat file upload
When any user previews the file → excelHtml renders the injected HTML → XSS fires
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)