Skip to content

password reset emails with user+label@host are not correctly URL-encoded #15151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
johnstcn opened this issue Oct 21, 2024 · 0 comments · Fixed by #15167
Closed

password reset emails with user+label@host are not correctly URL-encoded #15151

johnstcn opened this issue Oct 21, 2024 · 0 comments · Fixed by #15167
Assignees
Labels
bug risk Prone to bugs

Comments

@johnstcn
Copy link
Member

johnstcn commented Oct 21, 2024

Relates to #14232

After creating a test password reset for a user with email of the form user+label@host, I noticed that the password reset URL was of the form https://<coder-url>/reset-password/change?otp=<random>&email=user+label@host.

This leads to the form not working properly due to the + being interpreted as a space ( ).

We should ensure that any inputs to the password reset URL are URL-encoded.

@coder-labeler coder-labeler bot added the bug risk Prone to bugs label Oct 21, 2024
defelmnq pushed a commit that referenced this issue Oct 23, 2024
Fixes #15151

This runs `urlencode` (provided by `text/template`) on the email address
in the link. This ensures the link will work if a user has an email in
the form `user+label@example.com`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug risk Prone to bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants