The vulnerability exists in the open-webui frontend application, specifically within a Svelte component responsible for handling rich text input. The analysis of the security advisory and the associated patch commit eb9c4c0e358c274aea35f21c2856c0a20051e5f1 confirms the root cause. The function replaceCommandWithText in src/lib/components/common/RichTextInput.svelte takes text from a user-created prompt, converts it to HTML using the marked library, and then prepares it for DOM insertion. The vulnerability is a classic DOM XSS, where untrusted content is passed to an innerHTML sink without proper sanitization. The marked library explicitly states it does not sanitize HTML, which is the core of the issue. An attacker with permissions to create prompts can store a malicious JavaScript payload. When a victim user, with the 'Insert Prompt as Rich Text' feature enabled, uses that prompt, the replaceCommandWithText function is called, and the payload executes. The patch confirms this by introducing DOMPurify.sanitize to clean the HTML generated by marked before it can be rendered, thus neutralizing the XSS threat.