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

Commit

Permalink
Deny redaction of events in a different room.
Browse files Browse the repository at this point in the history
We already correctly filter out such redactions, but we should also deny
them over the CS API.
  • Loading branch information
erikjohnston committed Jul 31, 2019
1 parent 72167fb commit cf89266
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit cf89266

Please sign in to comment.