mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-16 23:43:03 +00:00
- Critical (auth): the resume-stream handler verified chat ownership but not that the requested message_id actually lives in that chat. Because the Redis log is keyed by message_id alone, an attacker who learned a victim's message_id could pass one of their own chat_ids to satisfy the ownership check and replay the victim's stream. Added an explicit message-to-chat binding check via Chats.get_message_by_id_and_message_id after the ownership check. - Safety: reject non-dict payloads (`if not isinstance(data, dict)`) so stray client input — string/list/null — doesn't raise AttributeError on `data.get(...)`. - Perf: the per-token log append was doing two Redis round-trips (XADD + EXPIRE) on the streaming hot path. Collapse them into a single pipeline execute (one RTT), and refresh the TTL only every 64 appends instead of every append. With a 1h TTL that still leaves comfortable headroom for even pathologically long responses without EXPIRE ever risking mid-stream expiry. - Protocol cleanup: removed the resume-stream:ack emission. The frontend doesn't consume it and YAGNI — the seq idempotency guard in chatEventHandler already delivers the observability (you can see last_seq advance as replays arrive). Can be added back when a concrete client-side use case appears. |
||
|---|---|---|
| .. | ||
| data | ||
| internal | ||
| migrations | ||
| models | ||
| retrieval | ||
| routers | ||
| socket | ||
| static | ||
| storage | ||
| test | ||
| tools | ||
| utils | ||
| __init__.py | ||
| alembic.ini | ||
| config.py | ||
| constants.py | ||
| env.py | ||
| functions.py | ||
| main.py | ||
| tasks.py | ||