The vulnerability is a stored Cross-Site Scripting (XSS) issue in Open WebUI, originating from an incomplete fix for previous, similar vulnerabilities (GHSA-3wgj-c2hg-vm6q and GHSA-3856-3vxq-m6fc). While user and webhook profile images were patched to prevent SVG-based XSS, the same security measures were not applied to model profile images.
The root cause is twofold:
- Input Validation Failure: The
ModelMeta Pydantic class in backend/open_webui/models/models.py lacked a @field_validator for the profile_image_url field. This allowed malicious data:image/svg+xml URIs to be saved to the database through API endpoints for creating, updating, or importing models.
- Output Handling Failure: The
get_model_profile_image function in backend/open_webui/routers/models.py, which serves the image to the user's browser, did not validate the MIME type of the data URI before serving it. It also failed to set the X-Content-Type-Options: nosniff HTTP header in the response.
An attacker could exploit this by creating or updating a model and setting its profile image to a crafted SVG payload disguised as a data URI. When another user's browser requests this image, the server would respond with the SVG content and a Content-Type: image/svg+xml header. Without the nosniff header, the browser renders the SVG, executing the embedded JavaScript in the context of the Open WebUI origin. This allows the attacker to steal the victim's authentication token from localStorage, leading to a full account takeover.