summary refs log tree commit diff
path: root/packages/overlays/matrix-synapse/patches/0029-Apply-should_drop_federated_event-to-federation-invi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/overlays/matrix-synapse/patches/0029-Apply-should_drop_federated_event-to-federation-invi.patch')
-rw-r--r--packages/overlays/matrix-synapse/patches/0029-Apply-should_drop_federated_event-to-federation-invi.patch54
1 files changed, 0 insertions, 54 deletions
diff --git a/packages/overlays/matrix-synapse/patches/0029-Apply-should_drop_federated_event-to-federation-invi.patch b/packages/overlays/matrix-synapse/patches/0029-Apply-should_drop_federated_event-to-federation-invi.patch
deleted file mode 100644

index ddc4c02..0000000 --- a/packages/overlays/matrix-synapse/patches/0029-Apply-should_drop_federated_event-to-federation-invi.patch +++ /dev/null
@@ -1,54 +0,0 @@ -From 411d239db47158cc14f94c94a86a5c713d783821 Mon Sep 17 00:00:00 2001 -From: Shay <hillerys@element.io> -Date: Fri, 2 May 2025 06:04:01 -0700 -Subject: [PATCH 29/74] Apply `should_drop_federated_event` to federation - invites (#18330) - -Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> ---- - changelog.d/18330.misc | 1 + - docs/modules/spam_checker_callbacks.md | 2 ++ - synapse/federation/federation_server.py | 6 ++++++ - 3 files changed, 9 insertions(+) - create mode 100644 changelog.d/18330.misc - -diff --git a/changelog.d/18330.misc b/changelog.d/18330.misc -new file mode 100644 -index 0000000000..dcf341fa34 ---- /dev/null -+++ b/changelog.d/18330.misc -@@ -0,0 +1 @@ -+Apply `should_drop_federated_event` to federation invites. -diff --git a/docs/modules/spam_checker_callbacks.md b/docs/modules/spam_checker_callbacks.md -index c7f8606fd0..063099a127 100644 ---- a/docs/modules/spam_checker_callbacks.md -+++ b/docs/modules/spam_checker_callbacks.md -@@ -353,6 +353,8 @@ callback returns `False`, Synapse falls through to the next one. The value of th - callback that does not return `False` will be used. If this happens, Synapse will not call - any of the subsequent implementations of this callback. - -+Note that this check is applied to federation invites as of Synapse v1.130.0. -+ - - ### `check_login_for_spam` - -diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py -index f9e97ea13e..2f2c78babc 100644 ---- a/synapse/federation/federation_server.py -+++ b/synapse/federation/federation_server.py -@@ -701,6 +701,12 @@ class FederationServer(FederationBase): - pdu = event_from_pdu_json(content, room_version) - origin_host, _ = parse_server_name(origin) - await self.check_server_matches_acl(origin_host, pdu.room_id) -+ if await self._spam_checker_module_callbacks.should_drop_federated_event(pdu): -+ logger.info( -+ "Federated event contains spam, dropping %s", -+ pdu.event_id, -+ ) -+ raise SynapseError(403, Codes.FORBIDDEN) - try: - pdu = await self._check_sigs_and_hash(room_version, pdu) - except InvalidEventSignatureError as e: --- -2.49.0 -