diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-12-10 07:17:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 07:17:28 -0500 |
commit | 9562f0c2f1bd3489bfbb64fddbbd21ed657b44dd (patch) | |
tree | 89c60cececaf4b4c83784f814b840ad61d5e3baa /synapse/push/pusherpool.py | |
parent | Do not allow cross-room relations, per MSC2674. (#11516) (diff) | |
download | synapse-9562f0c2f1bd3489bfbb64fddbbd21ed657b44dd.tar.xz |
Ensure emails are canonicalized before fetching associated user. (#11547)
This should fix pushers with an email in non-canonical form is used as the pushkey.
Diffstat (limited to 'synapse/push/pusherpool.py')
-rw-r--r-- | synapse/push/pusherpool.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py index 26735447a6..7912311d24 100644 --- a/synapse/push/pusherpool.py +++ b/synapse/push/pusherpool.py @@ -27,6 +27,7 @@ from synapse.push.pusher import PusherFactory from synapse.replication.http.push import ReplicationRemovePusherRestServlet from synapse.types import JsonDict, RoomStreamToken from synapse.util.async_helpers import concurrently_execute +from synapse.util.threepids import canonicalise_email if TYPE_CHECKING: from synapse.server import HomeServer @@ -113,7 +114,9 @@ class PusherPool: """ if kind == "email": - email_owner = await self.store.get_user_id_by_threepid("email", pushkey) + email_owner = await self.store.get_user_id_by_threepid( + "email", canonicalise_email(pushkey) + ) if email_owner != user_id: raise SynapseError(400, "Email not found", Codes.THREEPID_NOT_FOUND) |