summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-08-01 13:14:46 +0100
committerGitHub <noreply@github.com>2019-08-01 13:14:46 +0100
commit58af30a6c77322224dd0ef4de5fa27699dccc869 (patch)
tree99e4e83b5262435fe90b190f8cdbf25444946ee8 /synapse
parentMerge pull request #5790 from matrix-org/erikj/groups_request_errors (diff)
parentNewsfile (diff)
downloadsynapse-58af30a6c77322224dd0ef4de5fa27699dccc869.tar.xz
Merge pull request #5802 from matrix-org/erikj/deny_redacting_different_room
Deny redaction of events in a different room.
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/message.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index e951c39fa7..a5e23c4caf 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -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