Summary
A server-side request forgery (SSRF) vulnerability in Open WebUI prior to version 0.9.5 stems from a parsing discrepancy between Python's urlparse and the requests library.
Under certain crafted URLs, this mismatch can allow attackers to bypass SSRF protections and coerce the server into making unintended outbound requests to internal or otherwise restricted endpoints.
Affected context
The issue arises in Open WebUI deployments where user-controlled URLs are accepted and passed through validation or filtering based on one URL parsing mechanism (such as urlparse), while the actual HTTP requests are executed by another component (such as the requests library).
When these two layers interpret certain ambiguous or malformed URLs differently, SSRF defenses can be bypassed, particularly in environments where Open WebUI can reach internal services or metadata endpoints from its network location.
Exploit preconditions
- Attack surface: Application endpoints that accept user-supplied URLs (e.g., connectors, webhooks, integrations, or proxy-like features).
- Required access: Ability to submit or control URL input fields exposed by Open WebUI (typically authenticated or feature-specific access, depending on deployment).
- Trigger point: Submission of specially crafted URLs that are validated by
urlparseor similar logic, but ultimately requested by therequestslibrary. - Why exploitation is possible: Differences in how URL components (scheme, host, port, userinfo, paths) are interpreted between the validation layer and the HTTP client allow malicious URLs to appear safe during validation while being resolved to attacker-chosen network locations at request time.
Why this happens
The root cause lies in inconsistent URL parsing and validation logic between different libraries.
Open WebUI relied on one parsing mechanism to enforce SSRF protections (e.g., checking schemes or allowed hosts) but delegated the actual network request to another library with subtly different parsing semantics.
This is a classic example of CWE-918 (Server-Side Request Forgery) combined with inconsistent input handling, where trust decisions are made on one interpretation of the URL, while the actual network behavior follows another.
Potential impact
- The server may initiate HTTP(S) requests to internal services not directly exposed to users.
- Attackers could potentially access cloud metadata services or internal admin panels, depending on network topology.
- Internal service discovery or port scanning from the perspective of the Open WebUI host could be performed.
- Sensitive configuration or environment information reachable over HTTP may be exposed.
- Outbound calls to attacker-controlled endpoints could be used to exfiltrate limited data or perform callback-based attacks.
General mitigation guidance
Effective mitigation focuses on making URL validation and HTTP request behavior consistent and conservative:
- Use a single, well-defined URL parsing routine for both validation and request preparation, ensuring that the same interpretation drives both decisions and execution.
- Implement allowlists of schemes (e.g., only
https) and, where feasible, hostnames or domains that the application is permitted to contact. - Normalize and canonicalize URLs before applying any security checks, reducing ambiguity caused by unusual encodings or userinfo components.
- Introduce network-level controls (such as egress filtering, firewall rules, or service mesh policies) to limit which hosts Open WebUI can reach.
- Apply the principle of least privilege to any integrations or connectors that perform outbound HTTP requests, so they only access strictly necessary endpoints.
How teams detect issues like this
Organizations can detect and monitor SSRF risks and parsing inconsistencies using a mix of code and operational approaches:
- Static analysis rules that flag locations where different URL parsing or validation libraries are used before making outbound HTTP requests.
- Code review checklists that require reviewers to verify consistent URL handling and explicitly documented allowlist behavior for outbound calls.
- Automated tests with edge-case URLs (embedded credentials, unusual schemes, encoded characters) to ensure validation logic matches runtime behavior.
- Runtime monitoring and logging of outbound requests, with alerts for connections to unexpected internal IP ranges or metadata endpoints.
- Security policy enforcement in CI/CD pipelines to prevent introduction of new direct HTTP calls without explicit SSRF safeguards.

