mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-14 11:57:44 +00:00
Merge pull request #5802 from matrix-org/erikj/deny_redacting_different_room
Deny redaction of events in a different room.
This commit is contained in:
commit
58af30a6c7
2 changed files with 4 additions and 1 deletions
1
changelog.d/5802.misc
Normal file
1
changelog.d/5802.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Deny redactions of events sent in a different room.
|
|
@ -795,7 +795,6 @@ class EventCreationHandler(object):
|
|||
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.
|
||||
|
@ -803,6 +802,9 @@ class EventCreationHandler(object):
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue