How I was able to do Mass Account Takeover[Bug Bounty]
The password reset flow validated the OTP only at the final step, and the OTP was not tied to the user account. An attacker could brute-force the OTP because there was no rate limit, and reuse a valid OTP to reset any user's password.
Published on medium.com
Bug Bounty
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.
Context
The target was a website with an OTP based password reset flow. The researcher describes the vulnerability as lying in the password reset page. To reset a password, a user needed two things: their username and their email address. The reset mechanism was based on a one time password (OTP) sent to the user.
The flow had three steps:
- Enter your username and email address.
- Enter the OTP you received.
- Enter the new password.

Setup
The report does not describe any particular tooling, accounts or versions. The researcher worked against a live target and used an attacker account alongside a victim account (referred to as victim123 with [redacted]).
Finding it
The researcher started by probing the second step of the reset flow, where the OTP is submitted. The idea was response manipulation: intercept the response to the OTP submission and change it from a failure to a success.
Exploitation
Step 1: Manipulate the response at step 2
The researcher entered the victim's username and email, submitted 123456 as the OTP, and changed the response from:
{"success":"false"}
to:
{"success":"true"}
The website then redirected to step 3 and allowed the researcher to enter a new password for the victim's account. However, when the new password was submitted, the site returned an error message saying "OTP invalid". The OTP was being validated again at the third step, so the client side response manipulation alone did not complete the reset.
Step 2: Submit a valid OTP belonging to the attacker
The researcher then tried entering a valid OTP from the attacker's own account at the third step. This time the password was successfully reset. The researcher rushed to log in with the victim's email and the new password, but could not log in. Because the OTP belonged to the attacker, the attacker's password had been reset instead of the victim's.
The request looked like this:
{"username":"victim123" "email":"[redacted]","newpass":"Pass@443","mfa":"432521"}
The request body carried the victim's email and username, but those parameters were effectively useless: the account whose password changed was determined by the OTP, not by the username and email in the body. The researcher re-sent the request and it still worked.
Step 3: Reuse the same OTP
Re-sending the request still succeeded, which revealed a second issue: the OTP was not invalidated until a new OTP was requested. The same OTP could be reused again and again as long as no new one was requested.
Step 4: Combine with brute force
Because the account being reset is chosen by the OTP rather than by the username and email, an attacker does not need the victim's username and email at all. The attacker can enter their own username and email and only needs to supply the victim's OTP at the third step.
To obtain the victim's OTP, the attacker can brute force it: there was no rate limit implemented. The attacker can change the password of every user whose OTP got entered during the brute forcing process.
Root cause
The reset flow trusted the OTP as the sole identifier of the account being reset, while still accepting username and email fields in the request body. Those fields were ignored for the purpose of choosing the account, so the OTP alone decided whose password changed. On top of that, the OTP was not invalidated after a successful use, only when a new OTP was requested, and there was no rate limit on OTP submission. The response manipulation at step 2 did not complete the reset because the OTP was validated again at step 3.
Impact
An attacker can change the password of any user whose OTP is entered during brute forcing, without knowing that user's username or email. The practical limit is time: the OTP expired after 1 hour, so an attacker could only change the password of victims who had requested an OTP during that 1 hour period. Even so, if the attacker has a victim's username and email, they can request a new OTP and brute force it.
Fix
The report does not state what was changed. Based on the findings, the fixes would be to bind the OTP to the account and session that requested it so that a valid OTP cannot reset a different account, to invalidate an OTP after a successful use, and to add rate limiting on OTP submission so that brute forcing is not practical.
Variants to test
- Submit a valid OTP from your own account at the final step of another user's reset flow. A positive result is that your own password changes, showing the OTP alone selects the account.
- Replay the same OTP in a second reset request without requesting a new one. A positive result is that the second reset succeeds.
- Manipulate the response at the OTP verification step to a success value. A positive result is that the flow advances to the password step; check whether the server validates the OTP again when the password is submitted.
- Send many OTP guesses in a short period. A positive result is that guesses are accepted without throttling, blocking or lockout.
- Change the username and email fields in the final request while keeping a valid OTP. A positive result is that the account tied to the OTP changes, not the account named in the body.
What happened, in plain words
A security researcher found a flaw in a website's password reset page. The reset used a one-time password (OTP) sent to the user, but the site made a serious mistake: it decided whose password to change based on the OTP alone, not on the username and email in the request. That meant an attacker could use their own account details and a victim's OTP to reset the victim's password. The OTP was also not invalidated after use and there was no limit on how many times an attacker could guess, so an attacker could brute-force OTPs and take over many accounts at once. The researcher demonstrated this step by step.
The target and the reset flow
The target was a website with a password reset feature that worked in three steps:
- Enter your username and email address.
- Enter the OTP you received.
- Enter the new password.

To reset a password, a user needed two things: their username and their email address. The reset mechanism was based on a one-time password (OTP) sent to the user. An OTP is a short code, often six digits, that is valid for a limited time and should only be used once. It is a way to prove you own the email address or phone number associated with the account.
Setup
The report does not describe any particular tooling, accounts or versions. The researcher worked against a live target and used an attacker account alongside a victim account (referred to as victim123 with [redacted]).
Finding it
The researcher started by probing the second step of the reset flow, where the OTP is submitted. The idea was response manipulation: intercept the response to the OTP submission and change it from a failure to a success. Response manipulation means altering the message that the server sends back to the browser, for example by using a tool that lets you edit network traffic. The goal is to trick the browser into thinking the server accepted the OTP when it did not.
Exploitation
Step 1: Manipulate the response at step 2
The researcher entered the victim's username and email, submitted 123456 as the OTP, and changed the response from:
{"success":"false"}
to:
{"success":"true"}
This is a JSON object. JSON is a common format for sending data between a browser and a server. The key success has the value "false" (as a string) meaning the OTP check failed. By changing it to "true", the researcher made the browser believe the check succeeded.
The website then redirected to step 3 and allowed the researcher to enter a new password for the victim's account. However, when the new password was submitted, the site returned an error message saying "OTP invalid". The OTP was being validated again at the third step, so the client side response manipulation alone did not complete the reset. Client side means in the browser; server side means on the web server. The manipulation only affected what the browser saw, not what the server did.
Step 2: Submit a valid OTP belonging to the attacker
The researcher then tried entering a valid OTP from the attacker's own account at the third step. This time the password was successfully reset. The researcher rushed to log in with the victim's email and the new password, but could not log in. Because the OTP belonged to the attacker, the attacker's password had been reset instead of the victim's.
The request looked like this:
{"username":"victim123" "email":"[redacted]","newpass":"Pass@443","mfa":"432521"}
This is the data sent to the server when submitting the new password. It includes the victim's username and email, a new password, and the OTP (here called mfa, which stands for multi-factor authentication, a second proof of identity). The request body carried the victim's email and username, but those parameters were effectively useless: the account whose password changed was determined by the OTP, not by the username and email in the body. The researcher re-sent the request and it still worked.
Step 3: Reuse the same OTP
Re-sending the request still succeeded, which revealed a second issue: the OTP was not invalidated until a new OTP was requested. The same OTP could be reused again and again as long as no new one was requested. Normally, an OTP should become invalid after one successful use, like a single-use ticket.
Step 4: Combine with brute force
Because the account being reset is chosen by the OTP rather than by the username and email, an attacker does not need the victim's username and email at all. The attacker can enter their own username and email and only needs to supply the victim's OTP at the third step.
To obtain the victim's OTP, the attacker can brute force it: there was no rate limit implemented. Brute forcing means trying many possibilities until one works. A rate limit is a restriction on how many requests you can make in a certain time. Without it, an attacker can try thousands of OTPs quickly. The attacker can change the password of every user whose OTP got entered during the brute forcing process.
Root cause
The reset flow trusted the OTP as the sole identifier of the account being reset, while still accepting username and email fields in the request body. Those fields were ignored for the purpose of choosing the account, so the OTP alone decided whose password changed. On top of that, the OTP was not invalidated after a successful use, only when a new OTP was requested, and there was no rate limit on OTP submission. The response manipulation at step 2 did not complete the reset because the OTP was validated again at step 3.
Impact
An attacker can change the password of any user whose OTP is entered during brute forcing, without knowing that user's username or email. The practical limit is time: the OTP expired after 1 hour, so an attacker could only change the password of victims who had requested an OTP during that 1 hour period. Even so, if the attacker has a victim's username and email, they can request a new OTP and brute force it.
Fix
The report does not state what was changed. Based on the findings, the fixes would be to bind the OTP to the account and session that requested it so that a valid OTP cannot reset a different account, to invalidate an OTP after a successful use, and to add rate limiting on OTP submission so that brute forcing is not practical.
Variants to test
- Submit a valid OTP from your own account at the final step of another user's reset flow. A positive result is that your own password changes, showing the OTP alone selects the account.
- Replay the same OTP in a second reset request without requesting a new one. A positive result is that the second reset succeeds.
- Manipulate the response at the OTP verification step to a success value. A positive result is that the flow advances to the password step; check whether the server validates the OTP again when the password is submitted.
- Send many OTP guesses in a short period. A positive result is that guesses are accepted without throttling, blocking or lockout.
- Change the username and email fields in the final request while keeping a valid OTP. A positive result is that the account tied to the OTP changes, not the account named in the body.
Glossary
- OTP (one-time password): A short code sent to a user, valid for a limited time and intended for single use, used to prove identity.
- Password reset flow: The sequence of steps a user goes through to set a new password when they have forgotten the old one.
- Response manipulation: Altering the data a server sends back to the browser, for example to change a failure message into a success message.
- JSON: A text-based format for representing data as key-value pairs, commonly used in web requests and responses.
- Client side: Actions or code that run in the user's browser, as opposed to on the server.
- Server side: Actions or code that run on the web server, which the user cannot directly change.
- Request body: The part of an HTTP request that carries data, such as form fields or JSON, sent to the server.
- Parameter: A named value in a request, like
usernameoremail. - Brute force: Trying many possible values (like OTPs) until one is correct.
- Rate limit: A restriction on how many requests can be made in a given time period.
- Account takeover: Gaining unauthorised access to someone else's account, often by changing their password.
- MFA (multi-factor authentication): A second form of proof, such as a code, in addition to a password.
- Session: A period of interaction between a user and a website, often tracked by a cookie or token.
- Cookie: A small piece of data stored by the browser and sent with requests to identify a session.
- Token: A value used to authenticate or identify a user or session, often in place of a password.
- API: A set of rules that lets different software components communicate, often used by web pages to send and receive data from a server.