Open WebUI's validate_url ran four checks on the URL before requests.get saw it. A validators-library URL syntax check. A scheme allowlist. An operator-configurable blocklist. A DNS resolution against urllib.parse.urlparse(url).hostname followed by a refusal to fetch when any answer was not globally routable. The fourth check is the SSRF gate. The hostname it resolved was the hostname requests was not about to dial.
CVE-2026-45400: Open WebUI's Private-IP Block List Asked `urlparse`. `requests` Asked a Different Parser.
vendor
pattern
cve
proof of concept
validate_url ran four layers. requests parsed the URL once more.
CVE-2026-45400 is the SSRF bypass in Open WebUI's validate_url fixed in 0.9.5. Pre-patch (0.9.4), backend/open_webui/retrieval/web/utils.py:67:
def validate_url(url: Union[str, Sequence[str]]):
if isinstance(url, str):
if isinstance(validators.url(url), validators.ValidationError):
raise ValueError(ERROR_MESSAGES.INVALID_URL)
parsed_url = urllib.parse.urlparse(url)
# Protocol validation - only allow http/https
if parsed_url.scheme not in ['http', 'https']:
raise ValueError(ERROR_MESSAGES.INVALID_URL)
if WEB_FETCH_FILTER_LIST:
if not is_string_allowed(url, WEB_FETCH_FILTER_LIST):
raise ValueError(ERROR_MESSAGES.INVALID_URL)
if not ENABLE_RAG_LOCAL_WEB_FETCH:
parsed_url = urllib.parse.urlparse(url)
ipv4_addresses, ipv6_addresses = resolve_hostname(parsed_url.hostname)
# This is technically still vulnerable to DNS rebinding attacks,
# as we don't control WebBaseLoader
for ip in ipv4_addresses + ipv6_addresses:
addr = ipaddress.ip_address(ip)
if not addr.is_global:
raise ValueError(ERROR_MESSAGES.INVALID_URL)
return TrueFour checks. None of them sloppy. A validators-library URL syntax check, a scheme allowlist, a WEB_FETCH_FILTER_LIST blocklist for operators who want to deny specific hosts, and the resolve-and-block layer that calls socket.getaddrinfo on the parsed hostname and refuses to fetch when any returned address fails the ipaddress.ip_address(ip).is_global predicate. The function was written by people who had read about SSRF. The standing comment above the resolve gate is its proof:
# This is technically still vulnerable to DNS rebinding attacks,
# as we don't control WebBaseLoaderThe team had thought about the gap between validate_url and the consuming loader. The gap they had thought about was temporal. They were watching the seam for an attacker who could change DNS answers between the resolution and the fetch. The seam turned out to admit a spatial attacker first.
Every caller of validate_url follows the same shape: validate the URL, then hand the original string to requests.get or aiohttp.ClientSession.get. backend/open_webui/retrieval/utils.py:181:
validate_url(url)
...
# allow_redirects=False prevents redirect-based SSRF: validate_url() above is
# called once on the originally-submitted URL...The originally-submitted URL is what validate_url checked. The originally-submitted URL is what requests reparses. They read the same bytes. They do not necessarily produce the same host.
The URL http://127.0.0.1:6666\@1.1.1.1 produced two different hosts
The PoC URL recorded in GHSA-8w7q-q5jp-jvgx is one line:
http://127.0.0.1:6666\@1.1.1.1urllib.parse.urlparse is, in practice, an RFC 3986 parser. RFC 3986's authority grammar is userinfo "@" host [ ":" port ]. @ is the userinfo-host delimiter. The userinfo character set is permissive and the parser does not recognise backslash as a delimiter. urlparse reads the netloc as 127.0.0.1:6666\@1.1.1.1, splits on @, and returns:
scheme = 'http'
hostname = '1.1.1.1'
port = None
path = ''requests and aiohttp use urllib3-style authority parsing, which follows WHATWG-aligned conventions for HTTP. The WHATWG URL Standard declares backslash equivalent to forward slash in http, https, ws, wss, and ftp URLs. The same byte string, parsed under those rules, normalises to:
http://127.0.0.1:6666/@1.1.1.1
│── host:port ─│
│── path ──│Host: 127.0.0.1. Port: 6666. Path: /@1.1.1.1.
The patch commit message names the four characters the two parsers split on differently: backslash, tab, CR, LF. None of them is a legal byte inside an unescaped URL; each must be percent-encoded if it appears as data. Neither urlparse nor urllib3 performs that percent-encoding at parse time. They each pick a different normalisation, and the normalisations name different hosts.
Walk the four pre-patch layers of validate_url against the PoC string. validators.url('http://127.0.0.1:6666\\@1.1.1.1') returns true; the library's regex is liberal about characters in the userinfo position. parsed_url.scheme is 'http'; the allowlist passes it. WEB_FETCH_FILTER_LIST runs is_string_allowed against the literal URL; operator blocklists are written for hostnames operators name, not for backslash-encoded loopback addresses, and the default value is empty. The resolve gate runs socket.getaddrinfo('1.1.1.1', None), gets back 1.1.1.1, runs ipaddress.ip_address('1.1.1.1').is_global, gets back True, and returns. The function approves the URL.
The next line in every caller is requests.get(url, ...). urllib3 reparses the same string. The TCP connection opens to 127.0.0.1 on port 6666.
Four checks ran against urlparse's view of the URL. None of them ran against the URL requests was about to dial.
The patch did not unify the two parsers. It refused the bytes where they would disagree.
The 0.9.5 patch (commit e7ba8978) adds eight lines at the top of validate_url:
@@ def validate_url(url):
if isinstance(validators.url(url), validators.ValidationError):
raise ValueError(ERROR_MESSAGES.INVALID_URL)
+ # Reject parser-confusing chars: urlparse and requests/aiohttp split
+ # on these differently, e.g. http://127.0.0.1\@1.1.1.1 → urlparse
+ # extracts 1.1.1.1 (public, passes filter) while requests connects
+ # to 127.0.0.1 (internal). Same shape with tab/CR/LF.
+ if any(ch in url for ch in ('\\', '\t', '\n', '\r')):
+ log.warning(f'Blocked URL with parser-confusing char: {url!r}')
+ raise ValueError(ERROR_MESSAGES.INVALID_URL)
+
parsed_url = urllib.parse.urlparse(url)The four pre-patch layers are unchanged. urlparse still reads 1.1.1.1 as the hostname of the malicious URL. urllib3 still reads 127.0.0.1. The resolve-and-block gate still trusts urlparse. The new layer is a string-level character check; it runs before either URL parser sees the input and refuses the URL whenever it contains a character that would make the two parses disagree.
This is the bouncer-fix shape. The fix in s3-proxy CVE-2026-42882 added a third middleware layer to detect when the auth path and the handler path would diverge; the auth middleware and the handler still consumed different representations. The fix in Nitro CVE-2026-44373 added an isPathInScope helper to pre-decode %2F and refuse forwarding when the decoded path escaped the scope; the radix3 match and the forwarded bytes still travelled across a TCP connection to an upstream that decoded once more. Open WebUI's fix for CVE-2026-45400 is the third instance of the move in the catalog: refuse the input where the two parses would disagree, do not make them agree.
The choice has a rationale the commit message states. Unifying urlparse with urllib3 would mean either patching CPython (the urlparse maintainers have repeatedly declined to track WHATWG, citing standard-library compatibility) or threading an alternative URL parser into a function whose four other checks all consume urlparse output. The bouncer is cheaper than the rewrite. The principle the commit message gives: "None of these characters is valid in an unencoded URL... so this is a pure defensive rejection with no legitimate-input false positives." The fix accepts that the two parsers will continue to disagree about strings nobody should be sending, and refuses to forward any of those strings to the parser that decides where the TCP socket opens.
The second time Open WebUI's gate ran on bytes the next layer would change
The exhibit that sits next to this one in Open WebUI's own history is CVE-2026-44721, where sanitizeResponseContent escaped < and > in the model-description input, the input contained neither character, and marked.parse then converted the markdown link [Click](javascript:alert()) into the <a href="javascript:..."> element the sanitiser was supposed to block. The fix wrapped marked.parse's output in DOMPurify.sanitize. The sanitiser ran on the input. The renderer produced the output. The two strings shared a function call between them; the function call manufactured the bytes the gate would have rejected.
Both bugs live in the same product. They share neither code path nor language. The CVE-2026-45400 SSRF lives in Python under backend/open_webui/retrieval/; the CVE-2026-44721 XSS lived in TypeScript under src/lib/components/chat/. They were authored by different contributors and fixed by different maintainers in different release cycles. What they share is the assumption that a value checked at the top of a function is the value used at the bottom of it. That assumption is held widely. It is held in any code that reads a string, validates it, and forwards it to a library that will reparse it.
The pattern catalog has nineteen prior exhibits of this shape. Most live in URL or HTTP-path parsing; several live in argument-list lexing, signature verification, or Kerberos hostname resolution. Open WebUI's pair adds two more substrates: markdown rendering and HTTP authority parsing. The class signature applies verbatim in both. The gate inspects the wrapped form. The action consumes the unwrapped one. The patch shape in this exhibit, refuse where they would disagree, is the catalog's third instance of the bouncer move and its first in pure Python.
PoC: GHSA-8w7q-q5jp-jvgx. Patch: open-webui/open-webui@e7ba8978.
The patch did not teach urlparse what requests sees. It refused the URLs where they would disagree.