This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Emails are not canonicalised on /_matrix/client/*/pushers/set #11458
Copy link
Copy link
Closed
Labels
S-MinorBlocks non-critical functionality, workarounds exist.Blocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Description
Description
Emails sent to /pushers/set
are not canonicalised, while they probably should.
Steps to reproduce
- choose an email with an uppercase letter in it, e.g.
FooBar@example.com
- set that email to a user via the admin API. The email will end up normalized in the DB
- try to set an email pusher with the same email. It should work but doesn't and returns with an
Email not found
error
Version information
- Homeserver: other
- Version: 1.47.0
- Install method: Docker/Kubernetes
- Platform: N/A
Here, the pushkey
should definitely be canonicalised for emails:
synapse/synapse/push/pusherpool.py
Lines 115 to 118 in 8c7a531
if kind == "email": | |
email_owner = await self.store.get_user_id_by_threepid("email", pushkey) | |
if email_owner != user_id: | |
raise SynapseError(400, "Email not found", Codes.THREEPID_NOT_FOUND) |
using canonicalise_email
:
synapse/synapse/util/threepids.py
Lines 66 to 69 in 8c7a531
def canonicalise_email(address: str) -> str: | |
"""'Canonicalise' email address | |
Case folding of local part of email address and lowercase domain part | |
See MSC2265, https://github.com/matrix-org/matrix-doc/pull/2265 |
Metadata
Metadata
Assignees
Labels
S-MinorBlocks non-critical functionality, workarounds exist.Blocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.