From 18719fef9c34d0b8e7948316a969f64033afc6ca Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Fri, 24 Jul 2026 08:27:24 +0200 Subject: [PATCH] fix: malformed WEB_FETCH_FILTER_LIST entry blocking all web fetches (#26910) Docker compose list-form environment syntax passes quotes through verbatim, so WEB_FETCH_FILTER_LIST="" reaches the backend as two literal quote characters rather than an empty string. Config parsing turned that into the filter entry '""', which has no "!" prefix and therefore landed in the allow list. A non-empty allow list requires every host to match one of its entries, and a quotes-only pattern can never match a hostname, so every fetch_url and web loader request was rejected with "URL blocked by filter list" and surfaced to the user as "The URL you provided is invalid". get_allow_block_lists now strips surrounding quote characters from each entry and drops entries that are empty after normalisation. Quoted but otherwise valid entries such as "example.com" or !"example.com" now behave as their unquoted forms, and garbage entries no longer convert the default blocklist into a match-nothing allowlist that blocks everything. Fixes #26908 --- backend/open_webui/utils/misc.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/backend/open_webui/utils/misc.py b/backend/open_webui/utils/misc.py index 074f7c859b..cff3ad6e40 100644 --- a/backend/open_webui/utils/misc.py +++ b/backend/open_webui/utils/misc.py @@ -29,18 +29,26 @@ def deep_update(d, u): return d +def _strip_filter_entry(entry): + # Compose list-form env syntax passes surrounding quotes through verbatim + return (entry or '').strip().strip('"\'').strip() + + def get_allow_block_lists(filter_list): allow_list = [] block_list = [] - if filter_list: - for d in filter_list: - if d.startswith('!'): - # Domains starting with "!" → blocked - block_list.append(d[1:].strip()) - else: - # Domains starting without "!" → allowed - allow_list.append(d.strip()) + for raw_entry in filter_list or []: + entry = _strip_filter_entry(raw_entry) + is_blocked = entry.startswith('!') + if is_blocked: + entry = _strip_filter_entry(entry[1:]) + if not entry: + continue + if is_blocked: + block_list.append(entry) + else: + allow_list.append(entry) return allow_list, block_list