Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix DoS when there is a cycle in redaction events
Browse files Browse the repository at this point in the history
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 0f2ecb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synapse/storage/events_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0f2ecb9

Please sign in to comment.