Summary
Open WebUI's URL validation only checked the initially supplied URL, but not the targets of HTTP redirects followed by downstream HTTP clients.
An authenticated user could submit a seemingly safe public URL that 3xx-redirects to internal or metadata addresses and have Open WebUI fetch and return the internal response body through various API endpoints.
Affected context
This vulnerability appears in Open WebUI deployments where:
- The backend is reachable by authenticated users.
- The retrieval and image-related endpoints accept user-supplied URLs.
- Downstream HTTP clients (e.g., requests, aiohttp, langchain WebBaseLoader) automatically follow redirects.
- The application relies on a block list to prevent access to private or metadata IP ranges, but only applies it to the initial URL.
In such environments, internal services or cloud metadata endpoints may be accessible from the Open WebUI host, even when they are not exposed to end users directly.
Exploit preconditions
- Attack surface: HTTP endpoints that accept URLs and fetch remote content, including:
/api/v1/retrieval/process/web/api/v1/images/...routes/api/chat/completionswhen usingimage_urlcontent parts- Any other route using the shared web retrieval utilities.
- Required access: Valid authenticated access to Open WebUI with permission to call these endpoints.
- Trigger point: Submission of a public URL that responds with a 3xx status and a
Locationheader pointing to an internal or metadata address (e.g., 127.0.0.1, 169.254.169.254, RFC1918 space). - Why exploitation is possible:
- The
validate_url()function validates only the original URL against a private-IP / metadata-IP block list. - HTTP clients used downstream automatically follow redirects without re-running validation on the final target.
- The backend returns the fetched content (or a derivative) to the caller, effectively proxying internal responses to the user.
Why this happens
The core issue is a classic Server-Side Request Forgery (SSRF) pattern: user-controlled URLs are fetched from the server's network context with incomplete validation of the final request destination.
Conceptually, the design assumed that validating the first URL was sufficient. However, HTTP clients such as requests, aiohttp, and langchain's WebBaseLoader follow redirects by default. Because redirect targets were not re-validated against the private and metadata IP block list, an attacker could chain a benign-looking external URL with a 3xx redirect pointing to an internal resource. This maps directly to CWE-918, where the server is tricked into making backend or internal requests on behalf of an attacker due to incomplete control over outbound HTTP destinations.
Potential impact
- Unauthorized access to internal HTTP services reachable from the Open WebUI host.
- Exposure of sensitive information from:
- Local admin panels or internal APIs (e.g.,
http://127.0.0.1:...). - Cloud provider metadata services (e.g.,
http://169.254.169.254/), which may reveal instance credentials or configuration. - Private services in RFC1918 address space (e.g.,
10.0.0.0/8,192.168.0.0/16). - Use of Open WebUI as a pivot point for internal reconnaissance via HTTP.
- Potential for chaining with other weaknesses (e.g., an internal admin endpoint with weak auth) to escalate into configuration tampering or code execution.
General mitigation guidance
Effective mitigation typically focuses on tightening how outbound HTTP requests are handled and reducing trust in user-supplied URLs:
- Re-validate after redirects: Ensure that every redirect target is subjected to the same IP and hostname validation as the initial URL, including checks against private, loopback, link-local, and metadata addresses.
- Disable or constrain redirects: Where possible, disable automatic redirect-following for user-supplied URLs, or enforce a strict maximum number of redirects and only allow redirects to the same origin or an allowlisted set of domains.
- Centralize URL validation: Use a single, well-reviewed validation function for all outbound requests that:
- Resolves hostnames to IPs.
- Re-checks after DNS resolution.
- Enforces block lists and allow lists consistently.
- Network-level egress controls: Use firewall rules, container network policies, or outbound proxies to prevent the application from directly reaching sensitive IP ranges (loopback, RFC1918, metadata services).
- Limit response exposure: Avoid returning raw internal responses directly to users; normalize, redact, or cache responses in a way that reduces information leakage.
- Least-privilege runtime configuration: Run the service with minimal network reach and credentials so that even if outbound requests are abused, the scope of damage is limited.
How teams detect issues like this
Detection strategies can combine code-level inspection with operational monitoring:
- Static analysis and code review:
- Flag any code paths where user-provided URLs are passed to HTTP clients that follow redirects.
- Check whether URL validation is applied only once before redirect handling instead of at each redirection step.
- Look for absence of network egress controls or missing block list checks on resolved IPs.
- Automated scanning:
- Use static analysis tools or linters configured with rules for SSRF patterns, including:
- Use of
requests.get,aiohttp.ClientSession.get, or similar methods called with user-controlled URLs. - Redirect-enabled HTTP clients without accompanying validation logic.
- Runtime and log monitoring:
- Monitor outbound HTTP traffic from the Open WebUI host for unusual destinations like:
127.0.0.1and other loopback addresses.169.254.169.254(cloud metadata).- Internal RFC1918 networks not normally contacted by the application.
- Inspect logs of retrieval endpoints for repeated or unusual URLs submitted by users, especially those that lead to internal hosts.
- Policy enforcement:
- Introduce CI/CD checks that enforce a standardized outbound HTTP helper which encapsulates safe URL validation, rejecting direct use of low-level HTTP client APIs in feature code.

