Leaking password reset token via referrer from external Twitter share button
The password reset page included the reset token in the URL, and clicking a social media link in the footer sent that full URL as the Referer header to the third-party site. An attacker controlling that third-party site could read the token and reset the victim's password, especially since the token could be reused.
Originally disclosed on HackerOne
- Fixed in 4 days
- Disclosed after 4 days
Hi Team,
#Description
It has been identified that the application is leaking referrer token to third party sites. In this case it was found that the pasword reset token is being leaked to third party sites which is a issue knowing the fact that it can allow any malicious users to use the token and reset the passwords of the victim.
Plus this issue becomes a bit more critical because I notice we can use the reset password tokens more then once which is another issue.
#Proof of concept
- Request a password reset link for a valid account
- Click on the reset link
- before resetting the password click on the social media links like twitter available in footer section
- you wold notice the below request
GET /WakaTime HTTP/1.1
Host: twitter.com
Connection: close
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://wakatime.com/reset_password/4b4e9757-b66e-44e1-9b2e-898386cefe27/2017-06-29T16%3A41%3A37Z/eb4f3b8186b8385c71d6c9f715073177e2928c6c
Accept-Language: en-US,en;q=0.8
Cookie: guest_id=v1%3A149433114446813234; privacy_2017=1; ads_prefs="HBERAAA="; kdt=siie8hORVuREtE5Z1i9Q4JG0CPtpkDz8NoF3SWGw; remember_checked_on=1;
As you can see in the referrer the reset token is getting leaked to third party sites. So, the person who has the complete control over that particular third party site can compromise the user accounts easily.
Best Regards, Prateek Tiwari
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the password reset token was placed in the URL path and the page did not use a referrer policy to stop the full URL being sent to external sites.
Impact
An attacker who controls the third-party site could obtain the reset token and reset the victim's password, and the token could be used more than once.
What the attacker needed
Victim clicks a password reset link; victim clicks a social media link on the reset page; attacker controls the third-party site
The fix
The token should not be exposed in the URL sent to external sites, and tokens should be single-use.
How it was found
- Request a password reset link for a valid account.
- Click on the reset link.
- Before resetting the password, click on a social media link such as Twitter in the footer.
- Observe the request to the third-party site containing the reset token in the Referer header.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you click a link, your browser often tells the new website where you came from by sending the previous page's address. Here, the previous page's address contained a secret code for resetting a password. If that code went to a website controlled by an attacker, they could use it to take over the account.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.