Files
open-webui/backend/open_webui/routers
Classic298andbrodmart 2d9939ed49 chore: add validate_url() to get_image_data() for cohort consistency hardening (#24518)
* chore: add validate_url() to get_image_data() for cohort consistency hardening

`get_image_data()` in `backend/open_webui/routers/images.py` fetches the
URL returned by the configured image generation API directly via
`session.get(data)` without first calling `validate_url()`. The sibling
`load_url_image()` in the same file (called from /images/edit) calls
`validate_url(data)` first — that gate was added under
GHSA-jgx9-jr5x-mvpv. The two functions handle structurally identical
input (an attacker-or-server-supplied URL string) and should enforce the
same SSRF gate as a matter of code hygiene.

In the current call graph, the URL passed to `get_image_data()` comes
from the admin-configured image generation API's response, so an
exploitable SSRF chain additionally requires admin-side trust delegation
(misconfigured/untrusted upstream image API, or a custom
OpenAI-compatible server that reflects user input into response URLs).
That makes the missing call a defense-in-depth gap rather than a
vulnerability per SECURITY.md Rule 9 — a position the GHSA-h7cc-wwjp-5xqh
advisory is being closed under. This change is hardening: it brings the
two image-fetch helpers into alignment so any future caller that begins
passing user-influenced URLs into `get_image_data()` is gated by the
same private-IP / loopback / metadata-IP filter the rest of the
codebase enforces.

Surface raised by brodmart in GHSA-h7cc-wwjp-5xqh.

Co-authored-by: brodmart <brodmart@users.noreply.github.com>

* chore: trim comment

---------

Co-authored-by: brodmart <brodmart@users.noreply.github.com>
2026-05-11 00:59:32 +09:00
..
2026-04-12 18:12:59 -05:00
2026-05-09 15:25:27 +09:00
2026-04-21 13:46:39 +09:00
2026-04-21 15:41:07 +09:00
2026-05-09 08:28:29 +09:00
2026-05-09 15:25:27 +09:00
2026-04-12 18:12:59 -05:00
2026-04-12 18:12:59 -05:00
2026-04-21 15:52:00 +09:00
2026-04-12 14:22:11 -05:00
2026-04-19 22:45:54 +09:00
2026-04-17 14:28:18 +09:00
2026-05-09 04:17:58 +09:00
2026-05-09 15:25:27 +09:00
2026-04-20 08:53:06 +09:00
2026-04-12 14:22:11 -05:00
2026-05-09 05:14:55 +09:00
2026-04-20 08:36:24 +09:00
2026-04-24 18:48:21 +09:00
2026-04-13 14:08:58 -05:00