Account takeover for $3000
The password reset endpoint accepted a request that identified the target account by email address instead of by the reset token, and the backend did not check the token. An attacker who knew a victim's email address could set a new password for that account without any interaction from the victim.
medium.com
Published on medium.com
We were hunting one of the private programs on HackerOne. The scope of this program was limited to a single domain, which was hosting an internal admin panel on a staging environment for testing purposes.
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 set-password endpoint trusted a client-supplied email parameter to choose the account and failed to validate the reset token before changing the password.
Impact
An attacker could set a new password for any user, including admins, with only the email address and no victim interaction, leading to full account takeover.
What the attacker needed
Knowledge of the victim's email address; no victim interaction needed
The fix
The set-password endpoint should require and validate a single-use reset token tied to the account, and should not accept an email parameter to choose the account.
How it was found
- Test the password reset feature with host header and extra email parameter tricks, which did not work.
- Open the reset link, set a new password, and capture the resulting set-password request.
- Note that invite, verification and admin-set-password flows use the same URL.
- Replace the reset token parameter with an email parameter for the victim and remove the token.
- Send the modified request, which sets a new password for the victim's account.
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 site emails you a special link containing a secret code (a token) that proves the request came from you. This site's password-change step never checked that code, so anyone could send a request naming any email address and choose a new password for it. Knowing just the email address was enough to take over the account.
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.