Opened 5 years ago
Last modified 13 months ago
#42957 assigned defect (bug)
Usernames ending in a period generate invalid reset password links in certain email clients
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch has-unit-tests needs-dev-note dev-feedback |
Focuses: | Cc: |
Description
Password reset links contain the username appended to the end of the URL. If the user name ends in a period the email client has to decide if the period is part of the URL or part of the punctuation of the sentence. For example:
<https://some-wordpress-site.com/wp-login.php?action=rp&key=V4LSmgBcwtqvFPEiFt0e&login=p.o.>
Gmail generates a clickable link that stops short of the final period. Outlook successfully links the entire URL.
Attachments (3)
Change History (26)
#3
@
5 years ago
It looks like this type of email can be sent out in 2 scenarios that I can find.
- New user email with a link to access their account
- Password reset.
I can confirm that both are broken for me in GMail, too. When clicking the link in GMail I get invalid token. I tested with the thick Outlook client and outlook.com webmail and both of those worked fine. Seems isolated to GMail. Given how many people use gmail this seems like a good one to fix.
Your initial patch fixed the Reset Password process with a test user.
Could you update the patch for the new user email process as well?
#5
@
3 years ago
It would be great to fix this bug, which I discovered as the source of pain for my users for years (and me, since I usually have to do a manual reset for them).
I see it's been dormant for a while, but I also see the fix. How can I help this fix go in?
This ticket was mentioned in PR #1095 on WordPress/wordpress-develop by daveagp.
2 years ago
#6
On my website we get about one email a month from a person who can't create an account. This turns out to be caused by https://core.trac.wordpress.org/ticket/42957
- you're using gmail
- you try to create an account name ending in a period, e.g. Dave P.
- the email is sent containing https://blah...&login=Dave%20P.
- gmail generally assumes links ending in periods have the periods added by humans and thus ignores them
- so clicking on it, you arrive at https://blah...&login=Dave%20P and the user's told the link is invalid
Fixes this by encoding the trailing period as an entity.
This is my first submitted pull request to WP, thanks in advance for telling me if any more steps are needed.
Trac ticket: https://core.trac.wordpress.org/ticket/42957
#7
@
2 years ago
@spacedmonkey1 Attempting to ping you since I see you listed as a component maintainer on Users and I'm not sure what steps might be needed to get this reviewed
This ticket was mentioned in Slack in #core by daveagp. View the logs.
2 years ago
#10
@
2 years ago
- Milestone changed from Awaiting Review to 5.8
Moving to 5.8
to see if we can close this out.
#11
@
2 years ago
- Milestone changed from 5.8 to 5.9
Today is 5.8 Beta 1. Ran out of time for this ticket to land. Punting to 5.9.
#12
@
19 months ago
I committed some changes to the Doc Block in the proposed PR, and I fixed the conflicts against trunk: https://github.com/WordPress/wordpress-develop/pull/1095
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
19 months ago
This ticket was mentioned in PR #1896 on WordPress/wordpress-develop by hellofromtonya.
19 months ago
#15
Supersedes PR #1095 which was based on master
instead of trunk
. trunk
has the polyfill and latest updates.
Trac ticket: https://core.trac.wordpress.org/ticket/42957
hellofromtonya commented on PR #1095:
19 months ago
#16
Closing as this PR is based on master
instead of trunk
. PR #1896 supersedes it.
#17
@
19 months ago
- Keywords dev-feedback added
- Milestone changed from 5.9 to 6.0
- Owner set to hellofromTonya
- Status changed from new to assigned
I'm not sure about the current approach to add a separate function. Rather, I'm wondering why this happens and if there are other ways to resolve it.
With 5.9 Beta 1 tomorrow, punting to 6.0 and assigning to myself to do the further investigation.
#18
@
19 months ago
IIRC the problem is in Gmail handling of urls. It assumes that if you end a url in a period, you actually mean the period as the end of a sentence. My hope is to add this compatibility for Gmail which at the same time is not harming any other service. Please let me know if there's anything I can do, because this is a pain for my users and causes toil for me that I would like to eliminate.
This ticket was mentioned in Slack in #core by costdev. View the logs.
14 months ago
#20
@
14 months ago
Per the discussion on the bug scrub, pinging @hellofromTonya to see if you've had time to do further investigation on a possible alternative approach?
This ticket was mentioned in Slack in #core by costdev. View the logs.
13 months ago
#22
@
13 months ago
- Milestone changed from 6.0 to Future Release
Per the discussion in the bug scrub, I'm moving this to Future Release as it still needs investigation on a possible alternative approach.
As the investigation isn't already scheduled, let's keep this off the 6.1 milestone until it progresses towards a resolution.
#23
@
13 months ago
Hi, what investigation is needed exactly? I would love to get this fixed ASAP.
Why is this code needed? Gmail auto-hyperlinking ignores periods at the end of plaintext links.
Why does it do this? My understanding is that it's a combination of two accessibility features:
(1) Gmail automatically turns plaintext links into hyperlinks. So you can click on even plaintext links, instead of copying and pasting.
(2) It assumes that if someone writes a plaintext link with a period at the end, it's meant as punctuation. E.g. "To blog, go to wordpress.com." The implied link is not wordpress.com. but it is wordpress.com instead.
The proposed fix changes the wordpress-generated plaintext link to one which doesn't fall into this accessibility interpretation. Of course, nothing is currently broken for people who copy-and-paste the URL, but this is not what most people do (can confirm as, in my volunteer role for cscircles.cemc.uwaterloo.ca I get lots of support requests from teachers and students who are running into this deficit).
I happen to work at Google (not on gmail) but if that is what is needed to move this forward I can even try to get any specific questions you have answered from folks working on gmail.
Thanks!
Periods are valid in URLs, but we can avoid the issue by forcing "." to encode to "%2E" when generating the link in the email. PHP automatically converts the "%2E" back to "." when it's passed into the receiving side.