Skip to main content
Vulnerability Database/CVE-2025-46571

CVE-2025-46571: Open WebUI XSS Vulnerability

CVE-2025-46571 is a cross-site scripting flaw in Open WebUI that lets low-privileged users upload malicious HTML files to target admin accounts. This post covers technical details, affected versions, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-46571 Overview

CVE-2025-46571 is a stored cross-site scripting (XSS) vulnerability in Open WebUI, a self-hosted artificial intelligence platform designed to operate entirely offline. Versions prior to 0.6.6 allow low-privileged users to upload HTML files containing JavaScript via the /api/v1/files/ backend endpoint. The endpoint returns a file identifier that renders the uploaded content in the browser, executing attacker-supplied script in the viewer's session context. If an administrator opens the link, the attacker can take over the admin account and ultimately achieve remote code execution (RCE) through Open WebUI functions. The issue is tracked under [CWE-79] and was fixed in version 0.6.6.

Critical Impact

An authenticated low-privileged user can escalate to admin and reach RCE if a targeted admin opens a malicious uploaded HTML link.

Affected Products

  • Open WebUI versions prior to 0.6.6
  • Self-hosted deployments exposing /api/v1/files/
  • Multi-tenant instances where low-privileged users can authenticate

Discovery Timeline

  • 2025-05-05 - CVE-2025-46571 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-46571

Vulnerability Analysis

The flaw sits in the Open WebUI file-handling router at backend/open_webui/routers/files.py. The upload endpoint accepts user-supplied files without restricting MIME type or sanitizing HTML content for low-privileged roles. When the file is later retrieved, the server returns it with a renderable content type, so the browser executes any embedded JavaScript in the origin of the Open WebUI application.

Under default settings, uploaded files are only accessible to the uploader and administrators. This boundary limits raw exposure, but it also establishes the exact social-engineering path required for exploitation: a low-privileged user shares the file identifier with an admin.

When an admin clicks the file link, the attacker-controlled script runs with the admin's session. The script can mint API tokens, modify functions, or register server-side function code, enabling pivot to RCE on the host running Open WebUI.

Root Cause

The root cause is missing role-based restriction on which users may upload content that gets rendered as HTML. The patch introduces a check against Users so that only admin-uploaded HTML is served with a renderable response, forcing non-admin uploads to be treated as non-executable content.

Attack Vector

Exploitation requires network access to the Open WebUI instance, a valid low-privileged account, and administrator interaction with the crafted file URL. No additional privileges or memory corruption primitives are required.

python
# Security patch excerpt - backend/open_webui/routers/files.py
 from fastapi.responses import FileResponse, StreamingResponse
 from open_webui.constants import ERROR_MESSAGES
 from open_webui.env import SRC_LOG_LEVELS
+
+from open_webui.models.users import Users
 from open_webui.models.files import (
     FileForm,
     FileModel,

Source: GitHub Commit ef2aeb7

The patch imports the Users model so the file content handler can resolve the uploader's role and reject HTML rendering for non-admins.

Detection Methods for CVE-2025-46571

Indicators of Compromise

  • POST requests to /api/v1/files/ from non-admin accounts with Content-Type: text/html or .html filenames.
  • Subsequent GET requests to the returned file identifier originating from admin user sessions or admin source IPs.
  • Creation or modification of Open WebUI functions shortly after an admin opens a user-shared file link.
  • Outbound network connections from the Open WebUI host process immediately following function changes.

Detection Strategies

  • Inspect reverse-proxy and application logs for file uploads with HTML MIME types or <script> payloads submitted by non-admin roles.
  • Correlate file upload events by low-privileged accounts with file-view events by administrator accounts within short time windows.
  • Alert on new or modified Open WebUI function records authored or triggered under an admin session that recently loaded a user-uploaded file.

Monitoring Recommendations

  • Centralize Open WebUI access logs and admin audit events for query and retention.
  • Monitor process execution on the Open WebUI host for unexpected child processes spawned by the Python application.
  • Track egress traffic from the Open WebUI container or VM to detect post-RCE command-and-control activity.

How to Mitigate CVE-2025-46571

Immediate Actions Required

  • Upgrade Open WebUI to version 0.6.6 or later, which contains the vendor fix.
  • Audit existing uploaded files for HTML content submitted by non-admin accounts and remove suspicious entries.
  • Review admin accounts for unauthorized API keys, functions, or configuration changes created since the vulnerable version was deployed.

Patch Information

The fix is available in Open WebUI 0.6.6. See the GitHub Security Advisory GHSA-8gh5-qqh8-hq3x and the GitHub Commit ef2aeb7 for the code change that restricts HTML rendering to admin-uploaded files.

Workarounds

  • Restrict account creation and disable low-privileged user signups until the upgrade is applied.
  • Place Open WebUI behind a reverse proxy that enforces Content-Security-Policy headers to block inline script execution on file responses.
  • Instruct administrators not to open file links shared by other users until the instance is patched.
bash
# Example nginx hardening to blunt stored XSS on file responses
location /api/v1/files/ {
    add_header Content-Security-Policy "default-src 'none'; sandbox;" always;
    add_header X-Content-Type-Options "nosniff" always;
    proxy_pass http://openwebui_upstream;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.