Cross Domain leakage of sensitive information - Leading to Account Takeover at Instagram Brand
The password reset page leaked the full reset link, including the security token and email address, in the Referer header to third-party sites such as Google Analytics and WordPress pixel. The owner of such a third-party site could capture the link and use it to set a new password, leading to account takeover.
- Paid in 2 months
- Disclosed after 2.3 years
Product / URL
https://instagram-brand.com/register/reset/<the security token here>?email=<your email here>
Description and Impact After a user clicks on the password reset link obtained in inbox, the page for password resetting functionality opens. If you monitor the HTTP Requests that are done while that page is loaded, you will come to know that the 'Password Leakage Link' is leaked to third party websites.
The owner of that website can perform a security compromise by grabbing those links.
Q. How will can account takeover be done? Ans: The third party has the password reset link. So they will request it in the browser. In the link, the email is also there. So, they know the username and they will set a new password and now they can use this information to perform complete account takeover.
Additional Information: The referrer header does not need a user interaction i.e. clicking the third party link. All the links are instantaneously transferred without any dependence on some other action.
Solution: The solution is very very SIMPLE. Just include the following HTML code in the following in code between <head> tags of the html of the page: <meta name="referrer" content="never" /> This will not send referrer headers to third party websites.
Reproduction Instructions / Proof of Concept
- Click on your password reset link.
- Observe the GET Requests using a local proxy.
Request # 1:
GET /<the parameters and values> HTTP/1.1 Host: www.google-analytics.com User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 Accept: */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Referer: https://en.instagram-brand.com/register/reset/<the security token here>?email=<the email address here> Connection: keep-alive
Request # 2:
GET /<the parameters and values> HTTP/1.1 Host: pixel.wp.com User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 Accept: */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Referer: https://en.instagram-brand.com/register/reset/<the security token here>?email=<the email address here> Connection: keep-alive
`
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
The password reset page did not restrict the Referer header, so the full URL containing the reset token was sent to third-party resources.
Impact
A third-party site owner could obtain the reset link and perform complete account takeover.
What the attacker needed
Victim clicks password reset link; third-party resource loaded on page
The fix
The page should include a meta referrer policy of 'never' so that no Referer header is sent to third-party sites.
How it was found
- Click on your password reset link.
- Observe the GET requests using a local proxy.
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 visit a web page, your browser often tells the next site where you came from by sending a 'Referer' header. Here, the password reset page included the secret reset token in that header, so any third-party site loaded on the page could see it. Anyone who sees that token can use it to reset the victim's password and 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.