Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Emails are not canonicalised on /_matrix/client/*/pushers/set #11458

Closed
sandhose opened this issue Nov 30, 2021 · 0 comments · Fixed by #11547
Closed

Emails are not canonicalised on /_matrix/client/*/pushers/set #11458

sandhose opened this issue Nov 30, 2021 · 0 comments · Fixed by #11547
Assignees
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@sandhose
Copy link
Member

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:

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:

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

@babolivier babolivier added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. S-Minor Blocks non-critical functionality, workarounds exist. labels Nov 30, 2021
@clokep clokep self-assigned this Dec 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants