From Forgot Password to Account Takeover: A Simple API Mistake
The forgot-password endpoint returned the victim's personal data, including a password reset token, in its HTTP response. An attacker who knew a user's email could use that token to change the victim's password and take over the account without any access to the victim's email.
Published on medium.com
Hallo pada kesempatan ini, saya ingin berbagi pengalaman ketika menemukan vulnerability pada fitur forgot password di sebuah website dan mendapatkan reward $$$.
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 backend reused a single handler that returned the full user record and the reset token in the forgot-password response instead of a generic acknowledgement.
Impact
An attacker could take over any account without email access, leak personal data, and potentially do this at scale across all users.
What the attacker needed
Victim's email address known; ability to send a reset request
The fix
The endpoint should return no user data at all, use a generic response, and ensure the reset token is only ever sent by email and never appears in an API response.
How it was found
- Trigger a password reset for the target account and intercept the request.
- Resend the same request and observe the response.
- Read the reset token from the response body.
- Open the password-change URL with that token.
- Set a new password and take over the 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 a password, a site usually emails you a secret link to set a new one. Here the site also put that same secret link (and other private details) directly in the reply it sent back to whoever asked for the reset. So anyone who could trigger a reset for someone else's email address could read the secret and change that person's password.
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.