//nefariousplan

CVE-2026-45401: Open WebUI Has One URL Validator and Five URL Fetchers

vendor

patterns

cve

proof of concept

CVE-2026-45401 is filed against validate_url() in backend/open_webui/retrieval/web/utils.py. validate_url() works as advertised. It resolves the submitted hostname, walks every returned IPv4 and IPv6 address through ipaddress.is_global, and rejects private ranges, loopback, and 169.254.169.254. The hostname it inspects is the one the caller submitted. Open WebUI 0.9.4 then turns around and calls requests.get, aiohttp.ClientSession.get, or langchain_community.document_loaders.WebBaseLoader._scrape on the same string, and the HTTP libraries default to following 3xx redirects. Five separate functions in the codebase do this. Five GitHub reporters each found one of them. The advisory's title is "SSRF Bypass via HTTP Redirect Following in Web-Fetch and Image-Load Endpoints (not addressed by CVE-2025-65958)."

The validator inspects what the user wrote. The fetcher reaches what the network said next.

validate_url() is one function. It has been the entire Open WebUI SSRF gate since the function was written. The version that shipped in 0.9.4 looks like this, abridged to the part that does the work:

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)

        if parsed_url.scheme not in ['http', 'https']:
            raise ValueError(ERROR_MESSAGES.INVALID_URL)

        if not ENABLE_RAG_LOCAL_WEB_FETCH:
            ipv4_addresses, ipv6_addresses = resolve_hostname(parsed_url.hostname)
            # Check if any of the resolved addresses are private
            # 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 True

The function does what its docstring would say if it had one. It rejects http://127.0.0.1/. It rejects http://169.254.169.254/. It rejects http://10.0.0.1/. It does this by resolving the hostname the caller wrote and walking the address list. The comment two lines into the resolve block says, in the codebase's own words, that this approach is technically still vulnerable, because the function has no authority over what the HTTP library does next.

Here is what the function next. get_content_from_url() in backend/open_webui/retrieval/utils.py, reached via the /api/v1/retrieval/process/web endpoint, looked like this on the same release:

def get_content_from_url(request, url: str) -> str:
    validate_url(url)

    # Streamed GET to check Content-Type without downloading the body.
    try:
        response = requests.get(url, stream=True, timeout=30)

requests.get defaults to allow_redirects=True. The validator inspects the URL the caller sent. The fetcher fetches whatever Location: header the public host returns. The two operate on the same url string in adjacent statements, and the string changes meaning between them.

The PoC fits in one line:

curl -X POST https://target/api/v1/retrieval/process/web \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://httpbin.org/redirect-to?url=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2F&status_code=302"}'

httpbin.org is global. validate_url('https://httpbin.org/...') returns True. requests.get follows the 302. The response body that lands in the response payload is whatever IMDSv1 served. Any authenticated user. Default configuration. No admin role.

Five call sites. The same one-line oversight in each.

The advisory enumerates five fetchers in the same codebase. Each independently calls an HTTP client with the redirect-follow default; each independently bypassed validate_url() once it received its 302.

  1. SafeWebBaseLoader._scrape in backend/open_webui/retrieval/web/utils.py, inheriting from langchain's WebBaseLoader._scrape, which invokes self.session.get(url, **self.requests_kwargs). The subclass's requests_kwargs only set timeout.
  2. _fetch in the same file, using aiohttp. (Fixed first; listed in the advisory for completeness.)
  3. get_content_from_url in backend/open_webui/retrieval/utils.py, the sync requests.get shown above. Reached via /api/v1/retrieval/process/web.
  4. load_url_image in backend/open_webui/routers/images.py, the image-edits endpoint. session.get(data, ssl=AIOHTTP_CLIENT_SESSION_SSL) with no allow_redirects argument.
  5. get_image_base64_from_url in backend/open_webui/utils/files.py, invoked from convert_url_images_to_base64 in backend/open_webui/utils/middleware.py on every /api/chat/completions request whose message content includes an image_url part.

Each was a separate GHSA report. The advisory lists them with reporter names: tenbbughunters for SafeWebBaseLoader, tempcollab for the already-fixed _fetch, sneaXOR for get_content_from_url, YLChen-007 for load_url_image, nayakchinmohan for the chat-completion image path. The remediation developer credit goes to Classic298, the maintainer who wrote the four fix PRs.

The four fix PRs landed across two days. PR #24491 (commit 88545415, May 9) closed three call sites in one diff. PR #24524 (commit d11e06f1, May 10) closed the chat-completion path the prior PR missed. PR #24518 (commit 2d9939ed, May 10) added validate_url() to a sixth fetcher, get_image_data, that was technically only reachable via admin-side configuration but lived in the same file as a patched sibling. PR #24534 (commit e7ba8978, May 10) closed a parser-level bypass in validate_url() itself, the http://127.0.0.1\@1.1.1.1 shape where urllib.parse.urlparse and requests disagree on which host the URL names.

The patches look identical because the bug is identical. The chat-completion image fix is the clearest:

 async def get_image_base64_from_url(url: str) -> Optional[str]:
     try:
         if url.startswith('http'):
-            # Validate URL to prevent SSRF attacks against local/private networks
+            # Validate URL to prevent SSRF attacks against local/private networks.
+            # allow_redirects=False prevents redirect-based SSRF: validate_url() is
+            # called only on the originally-submitted URL; following 3xx redirects
+            # without re-validation would let an attacker reach private IPs via a
+            # public host that redirects internally (e.g. cloud-metadata exfil).
             validate_url(url)
             session = await get_session()
-            async with session.get(url, ssl=AIOHTTP_CLIENT_SESSION_SSL) as response:
+            async with session.get(
+                url, ssl=AIOHTTP_CLIENT_SESSION_SSL,
+                allow_redirects=AIOHTTP_CLIENT_ALLOW_REDIRECTS
+            ) as response:

The diff is the keyword argument. Every fix in this cluster is the keyword argument.

The most reachable path was patched fourth.

get_image_base64_from_url runs on every /api/chat/completions request whose message content includes an image_url part. The middleware function convert_url_images_to_base64 walks the message list, sees a content item of type image_url, hands the URL to get_image_base64_from_url, and the function fetches the bytes and inlines them as base64. The handler has no special-endpoint requirement, no admin permission, no feature flag. The default chat UI sends image_url content parts on every multimodal turn that references an image by URL instead of base64.

The first redirect-SSRF PR closed the three call sites the first reporters identified. It did not close this one. PR #24524's commit message names what happened in the author's own words:

Cohort follow-up to PR #24491. That PR patched three call sites (SafeWebBaseLoader._scrape, get_content_from_url, load_url_image) to pass allow_redirects=False on the underlying HTTP client; this fourth call site in utils/files.py was missed.

The reporter for this sub-path, nayakchinmohan, filed it as a separate GHSA on May 10, the day after PR #24491 merged. The codebase carried the same one-line oversight on five functions; the fix author closed four in two days because four reporters were paid in credit. The fifth had been already closed; the sixth (get_image_data) got hardened in the same window as cohort consistency.

The vendor wrote a consolidation policy because the codebase produces consolidatable bugs.

Open WebUI's docs/SECURITY.md contains a clause not common to most projects' security policies. It is the one that produced the credit list above (paraphrased to remove inline dashes):

When multiple independent reporters describe the same vulnerability class but each demonstrates a distinct and separate exploitation vector (for example, the same missing authorization check reached through different endpoints), we will consolidate them into the earliest filing and credit every reporter who demonstrated a distinct path. Only one CVE will be issued for the consolidated advisory.

The policy is explicit. Each distinct sub-path of one class earns a credit. The class itself earns one CVE. The text reads as a procedural clarification; it is also an admission. The clause exists because the codebase produces reports of the shape the clause describes. Five reporters did not arrive at the same gate-on-input bug by independent inspection of the same one function. Five reporters arrived at five different fetchers that all skipped the same gate because the codebase has five different fetchers. The consolidation rule routes the disclosure economics around the absence of a central abstraction.

The policy also says, two clauses below the consolidation rule:

Credit-for-duplicates incentivizes flooding. If similar-but-later filings earn credit, the rational play is to skim open advisories and file variations. We already see this pressure. The first-filer rule is what limits it.

That sentence is about duplicates of one finding. The consolidation rule, in the same document, is about distinct findings of one class. The two rules together describe the local optimum the project has reached. Filers race to find a sub-path no earlier filing covered; the vendor consolidates; one CVE issues with N credits attached. The race is what produced this CVE's five-reporter credit list, and it is what surfaced the chat-completion image path that PR #24491's author had not seen. The dynamic is working as designed. It is working on a codebase whose design is what makes the dynamic necessary.

CVE-2025-65958 closed some of them. CVE-2026-45401 closed more.

The GHSA title is the receipt. (not addressed by CVE-2025-65958). The 2025 CVE was the first consolidated SSRF in this codebase's history. Some of the call sites that had validate_url() and not allow_redirects=False got patched then. Six months later, five more reporters arrived with five more call sites that had validate_url() and not allow_redirects=False. The previous CVE addressed the symptom on its visible surface. The next call site was wherever the codebase had added one between then and now.

This is the parallel-implementation-gap pattern. The Astro Cloudflare-adapter exhibit shows the gate failing to copy across packages, MLflow's exhibit shows it failing to copy across runtimes, Axios's shows it across branches of one function, JeecgBoot's across sibling methods on one controller class. CVE-2026-45401 shows the gate failing to copy across five sibling fetchers in one Python package, with the second consolidated CVE in the same package's history confirming the shape. It is also a design-debt-driver: the class recurs because the design carries the primitive. Each new fetcher in the package is one more place the gate could fail to copy.

The validator's own comment admits the gate-on-input model is broken.

The code admits the problem. The DNS-rebinding comment inside validate_url() has been in the codebase from the first version of the function. The author wrote it because the author understood that resolving the hostname once at gate time gives no guarantee about what the HTTP library resolves it to at fetch time. DNS rebinding and 3xx redirects are two members of the same class. The function inspects one URL; the network can produce a different one between inspection and fetch.

The parser-confusion patch (PR #24534) makes the class concrete a third way. urllib.parse.urlparse and the requests library disagree on how to split URLs containing backslash, tab, CR, or LF in the netloc. http://127.0.0.1\@1.1.1.1 resolves to 1.1.1.1 under urlparse (which passes the global-IP filter) and to 127.0.0.1 under requests (which is what actually connects). The validator and the fetcher were not even looking at the same URL. The fix adds a character blocklist to validate_url() so that the two libraries' disagreement can no longer be exploited by writing a URL the two libraries split differently.

Each of these three observations is the same observation. The gate's authority ends at the string. The HTTP library decides what host it actually contacts. The validator does not know what the library will do. The library does not consult the validator. The pattern of fix in CVE-2026-45401 is to teach each individual library call site to refuse the library's default behavior. The pattern of fix is not to write a function that does the validation and the fetch in one place.

The patches add allow_redirects=False five times. They did not add fetch_url.

Read the patch series as a body of work. The fix authors knew the bug class. PR #24524's commit message contains a phrase that names it precisely:

Apply the same one-line fix as the other three call sites.

The same one-line fix. Applied independently at the fifth call site, after the fourth. The patches did add one new thing, an environment variable: AIOHTTP_CLIENT_ALLOW_REDIRECTS, defined in backend/open_webui/env.py with a default of False and a docstring that says exactly why it exists. Each patched call site imports the variable and passes it. The codebase now has one centralized policy value and five places that import it.

What the patches did not add is a function. There is no fetch_url(url) in backend/open_webui that performs validate_url, executes requests.get or aiohttp.ClientSession.get with allow_redirects=False, and returns the response. There is no safe_fetch wrapper. The five fetchers remain five fetchers. Each remembers, in its own body, to call validate_url(url) and to pass allow_redirects=AIOHTTP_CLIENT_ALLOW_REDIRECTS. The sixth fetcher, whenever it is written, has to remember both. The safe_validate_urls helper in retrieval/web/utils.py already maps a list of URLs through validate_url; the package has the shape for safe_fetch, and it has not used it.

PoC: advisories/GHSA-rh5x-h6pp-cjj6

The patches add allow_redirects=False five times. They did not add a function called fetch_url. The codebase has one validator and five fetchers before CVE-2026-45401, and one validator and five fetchers after it. The next fetcher is somebody's pull request.