Password reset poisoning to ATO and OTP bypass.

4 years ago 198
BOOK THIS SPACE FOR AD
ARTICLE AD

Abhishek

Image for post

Image for post

A common way to implement password reset functionality is to generate a secret token and send an email with a link containing the token. If an attacker is able to change the host header they can then redirect the token to their website or server which can lead to password reset poisoning. It will be easy to understand with an example. Also its a P2 according to bugrowd, so if you find it then 💰Ka-ching💰

The way to go about this is to visit the forgot password page, fill in the email and then intercept the request and change the Host header to any website.

Image for post

Image for post

I changed to bing.com

Now check your mail if you have received the password reset link and contains bing.com in the url. If it does then its vulnerable to password reset poisoning.

Image for post

Image for post

Changing the host directly to any website doesn’t work most of the time. You can try to bypass this with below methods.

Add X-Forwarded-Host header

Host: redacted.com

X-Forwarded-Host: bing.com

Invert the websites

Host: bing.com

X-Forwarded-Host: redacted.com

For me the second method worked. Now many companies have different ways of representing mails. In the above received email you can clearly see that its bing.com but in the below image you can see its a bit different.

Image for post

Image for post

This can be an issue sometimes cause for this attack to be successfully exploited the victim needs to click the link. Which one would you most likely click, ofc the second one. This lead me receiving less bounty for the first one. This isn’t a huge problem, just letting you guys know.

Now how to receive the token or key once the user has clicked the link, for this you to need to setup a ngrok server. Go to ngrok.com create an account, login and follow the steps. Once the setup is complete copy the link of the web server that is generated.

Image for post

Image for post

Now paste the server name instead of bing.com

Image for post

Image for post

Now click the link received in the mail and check the Requests page, you will find your token.

Now just change the server name to the original website and change the password and there you have it ATO.

Read Entire Article