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.
release-v1.2.1
Richard van der Hoff 2019-07-26 06:36:48 +00:00
parent 70e18cee00
commit 0f2ecb961e
1 changed files with 4 additions and 0 deletions

View File

@ -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: