This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree 3 files changed +415
-0
lines changed
3 files changed +415
-0
lines changed Original file line number Diff line number Diff line change
1
+ Fix a long-standing bug where previously rejected events could end up in room state because they pass auth checks given the current state of the room.
Original file line number Diff line number Diff line change @@ -577,6 +577,21 @@ async def _iterative_auth_checks(
577
577
if ev .rejected_reason is None :
578
578
auth_events [key ] = event_map [ev_id ]
579
579
580
+ if event .rejected_reason is not None :
581
+ # Do not admit previously rejected events into state.
582
+ # TODO: This isn't spec compliant. Events that were previously rejected due
583
+ # to failing auth checks at their state, but pass auth checks during
584
+ # state resolution should be accepted. Synapse does not handle the
585
+ # change of rejection status well, so we preserve the previous
586
+ # rejection status for now.
587
+ #
588
+ # Note that events rejected for non-state reasons, such as having the
589
+ # wrong auth events, should remain rejected.
590
+ #
591
+ # https://spec.matrix.org/v1.2/rooms/v9/#rejected-events
592
+ # https://github.com/matrix-org/synapse/issues/13797
593
+ continue
594
+
580
595
try :
581
596
event_auth .check_state_dependent_auth_rules (
582
597
event ,
You can’t perform that action at this time.
0 commit comments