mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-19 00:03:21 +00:00
POST /api/v1/chats/new and POST /api/v1/chats/{id}/folder accepted a
caller-supplied folder_id with no validation — neither ownership, nor
existence, nor UUID format. The row was persisted with the supplied
value verbatim, so the DB ended up with chat rows whose folder_id
referenced another user's folder, a non-existent UUID, or even a
non-UUID string.
No read path surfaces this across users — every chat-folder read is
user_id-filtered on both sides — so this is referential-integrity
hardening rather than a security boundary fix. But there's no reason
to accept dangling references either, and the downstream consumers
shouldn't have to assume the column is clean.
Add a Folders.get_folder_by_id_and_user_id() lookup at both writers:
if a folder_id is supplied, it must match a folder owned by the
caller. None remains allowed (chat-without-folder is the default).
Non-existent and non-UUID values fall through to 404.
Reported by ShigekiTsuchiyama in GHSA-4vrg-2vcq-q7jc.
Co-authored-by: ShigekiTsuchiyama <ShigekiTsuchiyama@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| analytics.py | ||
| audio.py | ||
| auths.py | ||
| automations.py | ||
| calendar.py | ||
| channels.py | ||
| chats.py | ||
| configs.py | ||
| evaluations.py | ||
| files.py | ||
| folders.py | ||
| functions.py | ||
| groups.py | ||
| images.py | ||
| knowledge.py | ||
| memories.py | ||
| models.py | ||
| notes.py | ||
| ollama.py | ||
| openai.py | ||
| pipelines.py | ||
| prompts.py | ||
| retrieval.py | ||
| scim.py | ||
| skills.py | ||
| tasks.py | ||
| terminals.py | ||
| tools.py | ||
| users.py | ||
| utils.py | ||