Описание
Open WebUI Vulnerable to SSRF via OAuth Profile Picture URL in _process_picture_url (oauth.py)
Summary
A Server-Side Request Forgery (SSRF) vulnerability exists in _process_picture_url() in backend/open_webui/utils/oauth.py (line ~1338). The function fetches arbitrary URLs from OAuth picture claims without applying validate_url(), allowing an attacker to force the server to make HTTP requests to internal resources and exfiltrate the full response.
Vulnerable Code
The codebase already uses validate_url() for the same SSRF protection pattern in other paths:
backend/open_webui/utils/files.py:38-validate_url(url)beforerequests.get(url)backend/open_webui/routers/images.py:800-validate_url(data)beforerequests.get(data)
The omission in _process_picture_url() is inconsistent with the project's own security practices.
Affected Code Paths
- New user OAuth signup (line ~1556):
picture_url = await self._process_picture_url(picture_url, token.get('access_token')) - Existing user picture update on login (line ~1536): when
OAUTH_UPDATE_PICTURE_ON_LOGIN=true
Steps to Reproduce
Prerequisites
- Open WebUI instance with generic OIDC OAuth configured
ENABLE_OAUTH_SIGNUP=true
Setup
1. Start a minimal OIDC server that returns a malicious picture claim pointing to an internal canary endpoint:
2. Run the PoC server:
3. Start Open WebUI with Docker:
4. Create an admin account at http://localhost:3000, then sign out.
5. Click "Continue with TestOIDC" on the login page.
6. Observe the PoC server terminal - it prints !!! CANARY FETCHED - SSRF CONFIRMED !!!
7. Verify exfiltrated data is stored and readable:
Result: DECODED: SSRF_CONFIRMED_OPEN_WEBUI
The server fetched the attacker-controlled URL, base64-encoded the response, stored it as profile_image_url, and the attacker can read it back via the API.
Impact
An attacker can force the Open WebUI server to make HTTP requests to:
- Cloud metadata endpoints (AWS IMDSv1 at
http://169.254.169.254/latest/meta-data/iam/security-credentials/) to steal IAM credentials - Internal network services not exposed to the internet
- Localhost-bound services (Redis, Elasticsearch, internal APIs)
This is a full-read SSRF: the complete HTTP response body is exfiltrated to the attacker via the base64-encoded profile_image_url field.
Configuration Note
This vulnerability requires ENABLE_OAUTH_SIGNUP=true (for the new-user path) or OAUTH_UPDATE_PICTURE_ON_LOGIN=true (for the existing-user path). While these are not default settings, they are standard in production deployments that use OAuth for user management, which is the primary use case for configuring OAuth at all.
Suggested Fix
Apply validate_url() before fetching, consistent with existing patterns in the codebase:
Пакеты
open-webui
<= 0.8.12
0.9.0
Связанные уязвимости
Open WebUI is a self-hosted artificial intelligence platform designed to operate entirely offline. Prior to 0.9.0, a Server-Side Request Forgery (SSRF) vulnerability exists in _process_picture_url() in backend/open_webui/utils/oauth.py (line ~1338). The function fetches arbitrary URLs from OAuth picture claims without applying validate_url(), allowing an attacker to force the server to make HTTP requests to internal resources and exfiltrate the full response. This vulnerability is fixed in 0.9.0.
Уязвимость функции _process_picture_url() (backend/open_webui/utils/oauth.py) веб-интерфейса на базе искуственного интеллекта Open WebUI, позволяющая нарушителю осуществить SSRF-атаку