mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
[PR #24506] [MERGED] fix: enforce message ownership in group/DM channel update + delete endpoints #98727
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24506
Author: @Classic298
Created: 5/9/2026
Status: ✅ Merged
Merged: 5/10/2026
Merged by: @tjbck
Base:
dev← Head:fix/channels-message-ownership-group-dm📝 Commits (2)
9a8b955fix: enforce message ownership in group/DM channel update + delete endpoints1e5886bchore: trim comments📊 Changes
1 file changed (+6 additions, -0 deletions)
View changed files
📝
backend/open_webui/routers/channels.py(+6 -0)📄 Description
update_message_by_id(channels.py:1348) anddelete_message_by_id(channels.py:1550) branch onchannel.type. Theelsebranch (standard channels) correctly enforcesmessage.user_id != user.idownership before mutating, but theif channel.type in ['group', 'dm']branch only checkedis_user_channel_member— channel membership alone, with no message ownership verification.Effect on group/DM channels: any verified member of the conversation could:
user_id=victim, producing tampered content that renders to other members as the original author's authentic post (integrity + authenticity);Reproduced end-to-end against v0.9.4 with three users (attacker, victim, viewer) sharing a group channel: attacker overwrites victim's message and deletes another, viewer reads the tampered content as victim-authored.
Two patches, identical shape, mirror the
elsebranch's existing ownership semantics:update_message_by_idgroup/DM branch: addif user.role != 'admin' and message.user_id != user.id: raise 403immediately after theis_user_channel_membercheck.delete_message_by_idgroup/DM branch: same.The standard-channel branch is unchanged (it already enforced ownership). Admins remain able to moderate any message, matching the existing semantic in the standard-channel branch.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.