diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-07-26 06:36:48 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-07-26 06:36:48 +0000 |
commit | 0f2ecb961e580d5d039360edf041720680f8ad8c (patch) | |
tree | ebdafd9c74b455c161fca911f527cbb967de5112 /synapse/storage/events_worker.py | |
parent | Merge branch 'rav/redactions/cross_room_id' into release-v1.2.1 (diff) | |
download | synapse-0f2ecb961e580d5d039360edf041720680f8ad8c.tar.xz |
Fix DoS when there is a cycle in redaction events
Make sure that synapse doesn't explode when a redaction redacts itself, or there is a larger cycle.
Diffstat (limited to 'synapse/storage/events_worker.py')
-rw-r--r-- | synapse/storage/events_worker.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/events_worker.py b/synapse/storage/events_worker.py index 7dbb5df09a..06379281b6 100644 --- a/synapse/storage/events_worker.py +++ b/synapse/storage/events_worker.py @@ -637,6 +637,10 @@ class EventsWorkerStore(SQLBaseStore): # we choose to ignore redactions of m.room.create events. return None + if original_ev.type == "m.room.redaction": + # ... and redaction events + return None + redaction_map = yield self._get_events_from_cache_or_db(redactions) for redaction_id in redactions: |