Summary
A stored cross-site scripting (XSS) flaw in the Open WebUI Banner component allows attacker-controlled HTML and script content to be injected into a globally visible banner.
When a malicious or compromised administrator plants a payload, it is rendered for all users—including the Super Admin—enabling potential session theft and privilege escalation.
Affected context
The vulnerability arises in Open WebUI deployments that use the global Banner component for displaying messages to users.
Due to DOMPurify being applied before Markdown rendering (via the marked library), sanitization occurs on the wrong representation of the content.
In environments where administrators or integrations can modify banner content, this misordering can leave dangerous script-capable constructs in the final DOM.
The issue is especially relevant in multi-admin or semi-trusted admin setups where one administrator's changes are rendered to all users.
Exploit preconditions
- Attack surface: Web UI, specifically the global Banner feature rendered in user browsers.
- Required access: Ability to modify banner content (typically administrator-level permissions or compromised admin accounts).
- Trigger point: Viewing any page where the global banner is rendered in the browser; no further user interaction is necessarily required.
- Why exploitation is possible: The sanitization pipeline applies DOMPurify before Markdown-to-HTML conversion by marked, leaving the final HTML outside the sanitizer's protection. This lets carefully crafted content survive and become executable JavaScript in the rendered page.
Why this happens
The root cause aligns with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).
Instead of sanitizing the final HTML that is actually injected into the DOM, the application runs DOMPurify on the pre-rendered content and then uses the marked library to transform it into HTML afterward.
This sequencing error breaks the trust assumption that sanitized output will be the final content rendered to the browser.
As a result, certain payloads can be encoded in a way that appears safe before Markdown processing but becomes dangerous once converted to HTML, bypassing the intended XSS protections.
Potential impact
- Theft of Super Admin or other users' session tokens, potentially leading to full account takeover.
- Privilege escalation from a lower-privileged or secondary administrator account to the Primary Admin (Super Admin).
- Execution of arbitrary JavaScript in users' browsers when they view the banner.
- Unauthorized changes to system configuration or AI workload settings via hijacked privileged sessions.
- Persistent compromise of user trust by injecting misleading or malicious content into the UI.
General mitigation guidance
Effective mitigation patterns focus on ensuring that sanitization is applied to the exact representation that reaches the browser and limiting who can inject rich content:
- Apply HTML sanitization (e.g., via DOMPurify or equivalent) after all transformations such as Markdown rendering, template expansion, or concatenation, so that the final HTML is what gets neutralized.
- Treat all banner or announcement content as untrusted, even when submitted by administrators, and enforce strict policies on allowed tags and attributes.
- Prefer safe-by-default rendering components that escape user-supplied content unless explicitly whitelisted.
- Reduce the privileges of administrative accounts by separating "content editors" from "system owners," and ensure critical actions require higher trust.
- Avoid executing or injecting dynamic scripts via banners or announcements; use static, text-only or strictly limited markup where possible.
How teams detect issues like this
Detection approaches can combine code-focused and behavior-focused methods:
- Static analysis and code review: Look for UI flows where user- or admin-supplied content is passed into Markdown renderers (like marked) and then inserted into the DOM using
innerHTML-style APIs without a final sanitization step. - Security review of pipelines: Verify the order of operations in content pipelines (e.g., Markdown → HTML → sanitize → render) and flag any instances where sanitization happens before transformations.
- Browser-side testing: Use automated UI tests or security scanners configured to input benign-looking but XSS-oriented payloads into banner or announcement fields, observing whether scripts execute in the rendered UI.
- Policy enforcement: Introduce development policies that ban direct DOM insertion of derived HTML without explicit sanitization, enforced through linters or CI checks.

