open-webui/backend/open_webui/models
G30 34b8844ccf
fix(models): gracefully handle legacy svg profile_image_url in ModelMeta validator (#25173)
The SVG-XSS hardening introduced in f5f4b5895 correctly rejects
data:image/svg+xml URIs on new input, but also caused a
pydantic_core.ValidationError when reading pre-existing models from
the database that had SVG data URIs stored as their profile images.

This ValidationError propagated unhandled through _to_model_model and
get_all_models, crashing the entire /api/models endpoint with HTTP 500
and leaving users with no models available in the UI.

Fix:
- Wrap validate_profile_image_url() in a try/except ValueError inside
  ModelMeta.check_profile_image_url. Legacy entries are cleared to None
  with a warning log instead of raising — the /model/profile/image API
  endpoint already falls back to /static/favicon.png when the value is
  empty.
- Default ModelMeta.profile_image_url to None instead of hardcoding
  /static/favicon.png, since the serving endpoint handles the fallback.
- Add a per-model try/except in ModelsTable.get_all_models so that any
  future unexpected validation failure on a single record skips that
  model with an error log rather than aborting the entire list.
2026-05-31 14:55:07 -07:00
..
access_grants.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
auths.py refac 2026-05-21 15:29:49 +04:00
automations.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
calendar.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
channels.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
chat_messages.py fix: preserve parent_id on chat_message upsert (#25205) 2026-05-31 14:50:05 -07:00
chats.py fix: gate chat-file links by caller access + repair insert_chat_files db arg (#25054) 2026-05-28 17:42:17 -05:00
feedbacks.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
files.py refac 2026-05-21 15:29:49 +04:00
folders.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
functions.py refac 2026-05-21 15:29:49 +04:00
groups.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
knowledge.py refac 2026-05-28 17:24:33 -05:00
memories.py refac 2026-05-21 15:29:49 +04:00
messages.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
models.py fix(models): gracefully handle legacy svg profile_image_url in ModelMeta validator (#25173) 2026-05-31 14:55:07 -07:00
notes.py refac 2026-05-14 01:49:34 +09:00
oauth_sessions.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
prompt_history.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
prompts.py fix(prompts): resolve undefined session variable in _get_access_grants and _to_prompt_model (#25129) 2026-05-28 16:23:25 -05:00
shared_chats.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
skills.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
tags.py refac 2026-05-21 15:29:49 +04:00
tools.py refac 2026-05-21 15:29:49 +04:00
users.py refac 2026-05-21 15:29:49 +04:00