Skip to content
Permalink
Browse files

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.
  • Loading branch information...
richvdh committed Jul 26, 2019
1 parent 70e18ce commit 0f2ecb961e580d5d039360edf041720680f8ad8c
Showing with 4 additions and 0 deletions.
  1. +4 −0 synapse/storage/events_worker.py
@@ -637,6 +637,10 @@ def _maybe_redact_event_row(self, original_ev, redactions):
# 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:

0 comments on commit 0f2ecb9

Please sign in to comment.
You can’t perform that action at this time.