Summary
Open WebUI contains a Server-Side Request Forgery (SSRF) issue in its OAuth picture URL processing, where arbitrary URLs from OAuth claims are fetched without prior validation.
An attacker who controls or tampers with OAuth picture claims can coerce the server into making HTTP requests to internal or otherwise restricted resources and return the full response body.
Affected context
This vulnerability appears in Open WebUI deployments that:
- Use OAuth authentication providers that supply a
pictureor avatar URL claim - Allow external or untrusted identity providers, or do not fully control claim contents
- Run the backend with network access to internal services (e.g., metadata services, internal APIs, admin panels)
The risk is most pronounced when the Open WebUI server can reach internal-only addresses (such as 127.0.0.1, private RFC1918 ranges, or cloud provider metadata endpoints) and when responses from the fetched URLs are propagated back to the client or logged.
Exploit preconditions
- Attack surface: The OAuth login / callback endpoint that processes user profile claims, specifically the
pictureURL claim. - Required access: Ability to register or use an OAuth identity whose
pictureclaim can be set or influenced (e.g., via a custom IdP, compromised IdP, or misconfigured trust relationship). - Trigger point: The
_process_picture_url()function inbackend/open_webui/utils/oauth.py, which fetches the URL from the claim without applyingvalidate_url(). - Why exploitation is possible: The server blindly issues HTTP requests to attacker-specified URLs, treating the claim as trustworthy and not restricting hostnames, schemes, or IP ranges. The response body is then accessible to the attacker, enabling internal data exfiltration.
Why this happens
The core issue is a lack of validation and normalization of externally supplied URLs before the backend issues outbound HTTP requests.
In _process_picture_url(), the OAuth picture claim is consumed as if it were trusted configuration, and validate_url() is not applied before making a request. This maps to CWE-918: Server-Side Request Forgery, where a server-side component makes network requests based on unvalidated or insufficiently constrained user input. The bug class is an overly trusted remote resource reference—no enforcement of allowed hosts, protocols, or address ranges, combined with returning or processing the full response.
Potential impact
- Access to internal HTTP services that are not directly exposed to users (e.g., admin interfaces, internal APIs).
- Exfiltration of sensitive data returned by internal services, such as configuration pages, status endpoints, or service metadata.
- Interaction with cloud metadata services, which may yield credentials, tokens, or configuration secrets.
- Use of the server as a pivot point for network reconnaissance of internal infrastructure (port scanning via timing and error differences, service discovery).
- Potential interaction with other internal vulnerabilities (e.g., hitting endpoints that perform state-changing actions) if combined with additional flaws.
General mitigation guidance
Mitigation typically focuses on constraining and sanitizing all outbound requests that originate from user-controllable input.
Common defensive patterns include:
- Enforcing strict URL validation routines before performing any HTTP request, including:
- Allowlisting acceptable schemes (e.g.,
httpsonly). - Restricting hosts and domains to known, trusted image/CDN providers.
- Resolving hostnames and rejecting private or loopback IP ranges, and blocking direct IP literals where appropriate.
- Separating external and internal network access so that application components handling user-controlled URLs cannot reach internal-only services.
- Using dedicated, limited-purpose HTTP clients (e.g., an image proxy) that enforce host and path restrictions by design.
- Minimizing the data returned to the client from fetched resources and avoiding blindly returning full response bodies.
- Applying least-privilege network policies (e.g., firewall rules, container network policies) to reduce reachable internal targets even if SSRF is present.
How teams detect issues like this
Detection can leverage both code-centric and operational perspectives:
- Static analysis and code review:
- Search for HTTP client calls (e.g.,
requests.get,httpx.get) that use URL variables derived from external inputs (OAuth claims, headers, query parameters). - Flag call sites where no validation, allowlist checking, or DNS/IP range filtering is applied before issuing the request.
- Review authentication and identity integration code paths for any processing of profile URLs, avatars, or webhooks.
- Security testing and monitoring:
- Use security testing tools to supply crafted OAuth
pictureURLs pointing to internal ranges (when safe and allowed in a test environment) and observe whether responses are proxied back. - Monitor outbound traffic from the application to detect unexpected connections to internal address spaces or metadata services.
- Policy enforcement:
- Establish coding guidelines that forbid direct outbound requests to user-supplied URLs and mandate the use of vetted helper functions for remote resource access.
- Integrate automated checks into CI to detect new instances of unvalidated URL fetches.

