Skip to content
Account takeover Write-up Beginner

How I Found a Bug That Could Let Anyone Hijack Your Account — Without Touching Your Email

The password reset endpoint trusted the email address supplied by the client instead of deriving the account from the reset token. An attacker could reset any user's password by changing the email parameter while using their own valid token.

Rahul.Masal Follow

Published on medium.com

Imagine you go to sleep with your bank account, your photos, your messages — all safely locked behind your password. You wake up and someone else is inside.

Rahul Masal, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server did not bind the reset token to the user account and instead trusted the email parameter from the client to decide whose password to reset.

Impact

An attacker could take over any registered user's account without needing access to their email or any interaction from the victim, and the victim would be locked out.

What the attacker needed

Attacker has a valid reset token for their own account; victim's email address is known; ability to intercept and modify HTTP requests

The fix

The reset token should be bound to the user at creation time, and on submission the server should look up the token to find the associated account and ignore any email parameter from the client.

How it was found

  1. Go to the Forgot Password page and enter your own email address.
  2. Open the reset link from the email and enter a new password.
  3. Intercept the outgoing request with Burp Suite before submitting.
  4. Change the email field to a different registered user's email address.
  5. Forward the modified request.
  6. Log in with the victim's email and the new password.

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 write-up has not been written yet. The Original tab links to the source.

When you forget your password, a website sends you a special link with a secret code. That code should only work for your account. Here, the website let someone use their own code but type in a different person's email address, and it changed that person's password instead.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by Rahul.Masal

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.