element-hq / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://element-hq.github.io/synapse
GNU Affero General Public License v3.0
1.34k stars 161 forks source link

Move public room call invite mitigations to `filter_events_for_client` #17359

Open anoadragon453 opened 3 months ago

anoadragon453 commented 3 months ago

This bit of code filters out call invite events in public rooms to prevent someone from being able to ring hundreds of people by sending a call event:

https://github.com/element-hq/synapse/blob/a023538822c8e241cdd3180c9cbbcb0f4eb84844/synapse/handlers/sync.py#L934-L941

@MadLittleMods asks whether it can be moved to filter_events_for_client rather than its current spot in _load_filtered_recents, so that the new native sliding sync implementation can utilise it (https://github.com/element-hq/synapse/pull/16908#discussion_r1651598029). Another alternative is to soft_fail the call invites.