Skip to content
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/
@@ -637,6 +637,10 @@ def _maybe_redact_event_row(self, original_ev, redactions):
# we choose to ignore redactions of events.
return None

if original_ev.type == "":
# ... 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.