Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Deny redaction of events in a different room. #5802

Merged
merged 2 commits into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5802.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deny redactions of events sent in a different room.
4 changes: 3 additions & 1 deletion synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,14 +795,16 @@ def is_inviter_member_event(e):
get_prev_content=False,
allow_rejected=False,
allow_none=True,
check_room_id=event.room_id,
)

# we can make some additional checks now if we have the original event.
if original_event:
if original_event.type == EventTypes.Create:
raise AuthError(403, "Redacting create events is not permitted")

if original_event.room_id != event.room_id:
raise SynapseError(400, "Cannot redact event from a different room")

prev_state_ids = yield context.get_prev_state_ids(self.store)
auth_events_ids = yield self.auth.compute_auth_events(
event, prev_state_ids, for_verification=True
Expand Down