/

CVE-2026-45315

Severity:

HIGH RISK

(8.7)

Stored XSS in Open WebUI Audio Transcriptions

CVE-2026-45315

Modified

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79, CWE-434, CWE-646

Impact:

Cross-Site Scripting in Application Web Origin

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Open WebUI's audio transcription upload endpoint allowed HTML files to be stored under a web-accessible cache path and served back with a text/html Content-Type.

A verified user with speech-to-text permissions could upload a polyglot WAV+HTML file and trick other users into opening its URL, causing attacker-controlled JavaScript to execute in the Open WebUI origin.

Affected context

This vulnerability appears in Open WebUI deployments where:

  • The audio transcription upload feature is enabled
  • The chat.stt permission is left at its default-on setting for verified users
  • Uploaded files are stored under CACHE_DIR/audio/transcriptions and then exposed via the /cache/{path} HTTP route

In this context, the application trusts the user-supplied filename extension to determine how the uploaded file will be served, and does not enforce a download-only disposition for cached content.

Exploit preconditions

  • Attack surface: Web UI, specifically the audio transcription upload endpoint and /cache/{path} serving route
  • Required access: Verified user account with chat.stt permission (enabled by default in vulnerable configurations)
  • Trigger point: Victim user follows or is redirected to the cached file URL, which is served as text/html in the Open WebUI origin
  • Why exploitation is possible: The server:
  • Accepts user-controlled filenames and trusts their extensions
  • Saves the file under a web-accessible path
  • Serves the file with Content-Type derived from the extension and without Content-Disposition, allowing inline rendering of attacker-controlled HTML/JavaScript

Why this happens

The core issue is a combination of:

  • CWE-79 (Improper Neutralization of Input During Web Page Generation): The application delivers attacker-controlled HTML/JavaScript content directly in the Open WebUI origin, allowing execution of arbitrary scripts.
  • CWE-434 (Unrestricted Upload of File with Dangerous Type): The upload endpoint accepts files whose effective type (based on extension) can be interpreted as active web content (e.g., .html) without restriction.
  • CWE-646 (Reliance on File Name or Extension of Client-Side File for Security): The server relies on the user-supplied extension to determine how content is served and trusted, instead of enforcing server-side type checks and safe serving semantics.

Abstractly, this reflects a pattern where uploaded files are stored under locations served by the main application origin, and their handling (MIME type and disposition) is derived directly from attacker-controlled metadata, enabling stored XSS via file upload.

Potential impact

  • Execution of arbitrary JavaScript in the Open WebUI origin for targeted users
  • Theft or exposure of session data accessible to JavaScript within the application context (e.g., tokens, local storage)
  • Cross-user request forgery within the application (e.g., triggering actions on behalf of the victim)
  • Manipulation of UI content, leading to phishing, credential harvesting, or misleading model responses
  • Potential pivoting into broader account or configuration misuse, depending on available client-side capabilities

General mitigation guidance

Effective mitigation centers on treating uploaded content as untrusted and isolating or neutralizing it before any browser can interpret it as active content.

Pattern-based mitigations include:

  • Restricting upload types: Enforce strict server-side validation of acceptable content types for the audio transcription endpoint (e.g., only audio formats) using a combination of content sniffing and whitelist-based checks, independent of the filename or extension.
  • Separating content origins: Serve user-uploaded files from a distinct domain or origin (e.g., a static file host or CDN) so that even if HTML is rendered, it does not share cookies, storage, or scripting context with the main application.
  • Forcing safe content disposition: Configure file responses to use Content-Disposition: attachment for user-uploaded or cached files, especially when their exact content type cannot be guaranteed, preventing inline rendering.
  • Normalizing filenames and extensions: Override user-provided filenames and extensions with server-generated naming schemes and safe extensions that match the treatment of the content (e.g., using .bin for opaque cache artifacts).
  • Reducing privileges of risky features: Gate audio transcription and file upload capabilities behind explicit, least-privilege roles and consider disabling them by default in deployments where they are not required.

How teams detect issues like this

Detecting this class of vulnerability typically involves a combination of static and dynamic approaches:

  • Static analysis and code review:
  • Flag any routes that serve files from user-writable directories without enforcing safe Content-Disposition or strict MIME-type controls.
  • Look for use of FileResponse (or equivalents) where the Content-Type is derived from on-disk extension or user-controlled values.
  • Identify upload endpoints that accept arbitrary filenames or extensions and store them under web-accessible paths.
  • Security testing:
  • Conduct targeted tests where files with HTML or script payloads are uploaded via audio or media endpoints and then accessed via application routes to see if they execute in the browser.
  • Use automated scanners configured to test for stored XSS via upload mechanisms and subsequent asset serving routes.
  • Policy enforcement:
  • Introduce architectural guidelines requiring that all user-uploaded content is served from a sandboxed origin or with attachment-only disposition.
  • Integrate checks in CI/CD pipelines that lint for unsafe file-serving patterns and unrestricted upload endpoints.

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-m8f9-9whg-f4xr

Frequently asked

questions

Yes, if the Open WebUI instance is exposed to the internet or reachable from untrusted networks, an attacker with a verified account and chat.stt permission can exploit it remotely by uploading a crafted file and distributing the URL to other users.

The attacker must be a verified user with the chat.stt permission enabled (which is on by default in affected versions). They do not need administrative privileges; the ability to upload audio for transcription and to share links with other users is sufficient.

The safest fix pattern is to strictly separate user-uploaded content from the main application origin and enforce server-side controls over what types of files can be uploaded and how they are served. In practice, this means limiting uploads to expected media types, forcing downloads rather than inline rendering for cached files, and avoiding any reliance on user-supplied filenames or extensions when determining response behavior.

To prevent similar vulnerabilities, adopt a design rule that no user-uploaded or user-controlled files are ever served directly from the primary application origin, and that all such content is treated as untrusted. Combine this with consistent use of output encoding, strict MIME-type enforcement, safe Content-Disposition headers, and regular security reviews of upload and file-serving pathways.

Find out what's already
exploitable in your codebase.