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

Commit 0f2ecb9

Browse files
committed
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.
1 parent 70e18ce commit 0f2ecb9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

synapse/storage/events_worker.py

+4
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,10 @@ def _maybe_redact_event_row(self, original_ev, redactions):
637637
# we choose to ignore redactions of m.room.create events.
638638
return None
639639

640+
if original_ev.type == "m.room.redaction":
641+
# ... and redaction events
642+
return None
643+
640644
redaction_map = yield self._get_events_from_cache_or_db(redactions)
641645

642646
for redaction_id in redactions:

0 commit comments

Comments
 (0)