Tale of Account Takeovers (Part-1)
The password reset endpoint accepted an array of email addresses instead of a single string, so the reset link was sent to both the victim and an attacker-supplied address. A second endpoint validated only a token but not the mobile number, allowing an attacker to change the reset destination to their own phone and receive the victim's OTP.
Vijaysimha Reddy Bathini Follow
Published on medium.com
Hello guys, I’m here with a new blog post on account takeover vulnerabilities that have been reported by me. I’ve started bug bounty in the month of Jan-2019 where I have reported quite of few low hanging fruits which ended up in duplicates.
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
This is a write-up about account takeover vulnerabilities found during bug bounty hunting. The author started bug bounty in January 2019 and, after leaving college, spent more time on recon and on understanding application functionality and flow. November 2019 was the author's best month so far, with several account takeovers reported and paid. The post covers two of them: one through HTTP parameter pollution in a forgot password request, and one through improper server-side validation of a mobile number in an OTP-based password reset. The author says six account takeovers had been found at the time of writing, with more to follow in later posts.
The author defines an account takeover as a vulnerability that lets an attacker take full control of a user's account without needing the password, by finding flaws in the application. The post names brute-forcing the OTP and account takeover through CSRF as other possible routes, but the two scenarios described here are the parameter pollution and mobile number cases.
Setup
The post does not describe the target program, the application, or its owner. Both scenarios involve a forgot password feature. In the first, the feature sends an email containing a password reset link to the address supplied in the request. In the second, after a valid email address is submitted, the user is offered two options: reset via OTP sent by email, or reset via OTP sent by mobile. The author used Burp Suite to capture and modify requests. The text does not describe the target or its preconditions beyond a forgot password feature.
Finding it
Scenario 1: parameter pollution in the reset request
The author captured the request made when the forgot password form was submitted. The body was JSON carrying the email address and a token:
{"email":"[redacted]","token":"some random token"}
Forwarding this request sent the reset link to that mail. The author then added a second email address by turning the email value into an array:
{"email":["[redacted]","[redacted]"],"token":"some random token"}
Forwarding the modified request sent the same password reset link to both addresses. The server accepted an array where it expected a single string and sent the same reset link to both addresses.
Scenario 2: mobile number swapped in the OTP reset request
After submitting a valid email address, the reset flow offered reset via OTP sent on email or reset via OTP sent on mobile. The author tried the email option first and found it secure, with nothing suspicious. The mobile option was then captured in Burp Suite. The data went to the server as JSON with two parameters, mobile and token. The token value was unique to the account. Changing the token produced an error, so the token was validated at the back end. Changing the mobile number from the victim's to the attacker's caused the OTP to be delivered to the attacker's mobile, and the victim's password was successfully changed.
Exploitation
Scenario 1, step 1: request a reset for the victim
The attacker issues a forgot password request for the victim account and captures it. The captured body is the JSON shown above with the victim's email and the token.
Scenario 1, step 2: add the attacker's address
The attacker adds their own email alongside the victim's in the email field, turning the value into an array, and forwards the request.
Scenario 1, step 3: use the link
A mail is sent to both the victim and the attacker, and the attacker resets the account password with the link they received, which leads to account takeover.

The image sits at the end of this scenario, next to the timeline: bug reported 3 November 2019, triaged 4 November 2019, bounty of 3000 USD.
Scenario 2, step 1: start the reset and pick the mobile option
The attacker issues a forgot password request on the victim's email and is given the two options, reset via email or via mobile number. The attacker selects reset via mobile and captures the request. The body is JSON with the mobile and token parameters described above.
Scenario 2, step 2: swap the mobile number
The attacker changes the mobile number from the victim's to their own and forwards the request.
Scenario 2, step 3: receive the OTP and reset
The attacker receives the OTP intended for the victim and uses it to reset the victim's password, leading to account takeover.

The image sits at the end of this scenario, next to the timeline: bug reported 7 November 2019, triaged the same day, bounty of 2000 USD.
Root cause
The report does not explain why the array was accepted; the same reset link was sent to both addresses.
In the second scenario the back end validated the token, which was unique to the account, but changing the mobile number still delivered the OTP to the attacker. The OTP was delivered to the attacker's number and the victim's password was changed. The email OTP option did not show the same weakness.
Impact
Both issues led to account takeover: the attacker obtained the reset link or OTP and set a new password without knowing the account password. The first scenario required the reset endpoint to accept the array form; the second required the mobile number to be changeable in the request. The author reports bounties of 3000 USD and 2000 USD for the two issues respectively.
Fix
The post does not say what the applications changed. Based on the findings, the reset endpoint should accept only a single email address and reject or ignore arrays and additional values, and the mobile reset should bind the mobile parameter to the account identified by the token, rejecting any number that does not belong to it, so the OTP can only go to the registered number.
Variants to test
-
Send the reset email field as an array with the victim's address and an attacker address, as in the first scenario. A positive result is a reset link arriving at the attacker's mailbox.
-
Send the mobile reset request with the victim's token and the attacker's number. A positive result is the OTP arriving on the attacker's phone and the victim's password being changeable.
-
The post closes with a tip credited to Bhavesh Thakur: intercept the request and put
email:victim mail%0d%0acc:hacker mail id. The server sends an email with the attacker's address in CC. A positive result is the CC copy arriving.
What happened, in plain words
This is a story about two bugs that let one person take over another person's account on a website. The author, Vijaysimha Reddy Bathini (who goes by FATRAT online), hunts for bugs in websites through bug bounty programs. That activity is called bug bounty hunting. He started in January 2019, and after finishing college he had more time to spend on it. November 2019 was his best month so far: he found several account takeovers and was paid well for them. He says he had found six account takeovers at the time of writing, and this post covers two of them.
An account takeover is a bug that lets an attacker get full control of someone else's account without knowing their password. The attacker finds a flaw in how the website works and abuses it to take control without needing the password. Think of it like finding that the reception desk of a building will hand a spare key to anyone who asks nicely, as long as they mention the real tenant's name.
The two bugs in this post both live in the forgot password feature, the button you click when you cannot remember your password. Normally that feature is supposed to send a reset link or a one-time code only to the real owner of the account. In both cases here, the website could be tricked into sending that secret to the attacker as well.
The first bug is called HTTP parameter pollution. A web request is a message your browser sends to a server, and it carries pieces of data called parameters (for example, the email address you typed into a form). Parameter pollution means sending a parameter in a shape the server did not expect, such as a list of values instead of a single value, and seeing whether the server mishandles it. Here the server accepted a list of two email addresses and sent the same reset link to both.
The second bug is about improper server-side validation of a mobile number. The website checked the token in the request, but changing the phone number still sent the OTP to the attacker. So the attacker could put their own phone number in and receive the victim's one-time code.
A one-time password (OTP) is a short code sent to you by email or text message that you type in to prove it is really you. It is a short code sent to you by email or text message that you type in to prove it is really you. If an attacker can receive your OTP, they can finish the password reset as if they were you.
Background: what the author was doing
The author explains that he spent time learning recon, which is short for reconnaissance: the work of mapping out what a website does, which pages and features exist, and how data flows between your browser and the server, before you start poking at it. He thanks Nahamsec and Jhaddix for their recon streams (live videos where they demonstrate this process). Understanding the functionality and the application flow is the key skill here: you cannot spot a broken reset flow unless you first understand how the normal reset flow is supposed to work.
He also mentions that early on he reported quite a few low hanging fruits, meaning easy-to-find bugs, which ended up as duplicates. A duplicate is when you report a bug that someone else already reported, so you do not get paid for it. This is a normal part of learning.
He lists other ways account takeovers can happen, such as brute-forcing the OTP (guessing the code by trying many possibilities) and account takeover through CSRF. CSRF, or cross-site request forgery, is when a malicious website tricks your browser into sending a request to another site where you are already logged in. Those are mentioned only as other categories; the two scenarios described in detail are the parameter pollution one and the mobile number one.
The tool: Burp Suite
Both scenarios involve capturing a request and changing it before it reaches the server. To do that, the author used Burp Suite, a program that sits between your browser and the website. Think of it as a mail intercepting service: your browser hands the letter to Burp instead of the post office, Burp shows you the letter, lets you edit it, and then forwards it. This is how you can see exactly what data the website sends when you click a button, and how you can change that data to test what the server does with unexpected input.
Scenario 1: sending the reset link to two people at once
What the feature did
The website had a forgot password form. When you submitted it, the site sent an email containing a password reset link to the address you provided. A reset link is a special web address that, when opened, lets you set a new password for the account. Whoever holds that link can change the password, so the link is a secret.
Step 1: capture the normal request
The author filled in the form and captured the request that the browser sent. The body of the request was JSON, a text format for structured data that looks a lot like a shopping list with labels. It carried two fields: the email address and a token.
{"email":"[redacted]","token":"some random token"}
Line by line:
- The outer curly braces
{and}mark the start and end of one JSON object, which is a bundle of labelled values. "email":"[redacted]"is one pair: the label (called a key) isemail, and the value is the address[redacted]. In this write-up,[redacted]stands for the real account owner's address."token":"some random token"is the second pair: a key calledtokenwith a placeholder value. A token here is a value the website includes in the request; in the second scenario it was unique to the account. Think of it as a numbered claim ticket: the server gave you the ticket earlier, and now checks that the number matches.- The comma between the two pairs separates them.
When the author forwarded this request unchanged, the reset link arrived at that email address. That is the normal, correct behaviour.
Step 2: turn one address into a list
The author then changed the email value from a single piece of text into a list (in JSON, a list is written with square brackets [ and ], with items separated by commas):
{"email":["[redacted]","[redacted]"],"token":"some random token"}
Line by line:
- The key is still
email, but its value is now["[redacted]","[redacted]"]. - The square brackets mean this is an array, which is just an ordered list of values. Here the list has two items: the victim's address and the attacker's address.
- The
tokenis unchanged.
Why do this? Because a well-built server should expect exactly one email address here; the author tested whether it would accept a list. The author was testing whether the server validates the shape of the data, not just its content.
When he forwarded the modified request, the same password reset link was sent to both addresses. That is the whole bug: the server accepted a list where it expected a single address, and the same reset link was sent to both addresses.
Step 3: use the link
The exploit scenario, as the author lays it out:
- The attacker starts a forgot password request for the victim's account and captures the request.
- The attacker adds their own email address alongside the victim's in the request and forwards it.
- A mail goes to both the victim and the attacker, and the attacker resets the account password with the link they received. That is the account takeover.

The image at this point in the post accompanies the timeline for this bug: reported on 3 November 2019, triaged on 4 November 2019, and a bounty of 3000 USD. Triaged means the company's security team looked at the report, confirmed it was a real issue, and passed it on to be fixed. A bounty is the money the company pays the researcher for finding and reporting the bug.
Scenario 2: sending the OTP to the attacker's phone
What the feature did
This second bug was reported right after the first one was paid, and it made account takeovers the author's favourite category. The website again had a forgot password feature. You entered your email address, and if it was valid, the site offered two options: reset via an OTP sent by email, or reset via an OTP sent by mobile phone.
Step 1: test the email option
The author tried the email option first. It was secure: nothing suspicious happened. This is an important habit. You compare the two paths, and the one that behaves correctly tells you what the correct behaviour looks like, so you can spot the one that does not.
Step 2: capture the mobile option
He then chose the mobile option and captured the request in Burp Suite. The data went to the server as JSON with two parameters, mobile and token. Two things stood out:
- The token value was unique to the account. In other words, the server had issued a token that identified this particular account's reset attempt.
- When he changed the token, the server returned an error. That means the server was checking the token properly. A wrong or made-up token was rejected.
So the token was protected. The question then became: what about the phone number next to it?
Step 3: swap the phone number
He changed the mobile number from the victim's number to his own. The token stayed the same. The server accepted the request, the OTP was delivered to the attacker's phone, and the victim's password was successfully changed. That is the account takeover.
The reason this works is that the server checked the token but never checked that the phone number belonged to the same account as the token. The server checked the token but still delivered the OTP to the changed number. Think of a bank teller who carefully checks your ID, then hands the cash to whoever is standing next to you because you pointed at them.
The exploit scenario, step by step
- The attacker starts a forgot password request on the victim's email and is offered the two options, reset via email or via mobile number.
- The attacker selects reset via mobile and captures the request.
- The attacker changes the mobile number from the victim's to their own and forwards the request.
- The attacker receives the OTP meant for the victim and uses it to reset the victim's password, leading to account takeover.

The image here accompanies the timeline for this bug: reported on 7 November 2019, triaged the same day, and a bounty of 2000 USD.
Why these bugs exist
In the first scenario the report does not explain why the array was accepted; the same reset link was sent to both addresses.
In the second scenario the back end validated the token, which was unique to the account, but changing the mobile number still delivered the OTP to the attacker. The OTP was delivered to the attacker's number and the victim's password was changed. The email OTP option did not show the same weakness.
What it means for users
Both issues led to account takeover: the attacker obtained the reset link or OTP and set a new password without knowing the account password. The first scenario required the reset endpoint to accept the array form; the second required the mobile number to be changeable in the request. The author reports bounties of 3000 USD and 2000 USD for the two issues respectively.
How it should be fixed
The post does not say what the applications changed. Based on the findings, the reset endpoint should accept only a single email address and reject or ignore arrays and additional values. The mobile reset should tie the mobile parameter to the account identified by the token, rejecting any number that does not belong to it, so the OTP can only go to the registered number.
Things to try yourself
-
Send the reset email field as an array with the victim's address and an attacker address, as in the first scenario. A positive result is a reset link arriving in the attacker's mailbox.
-
Send the mobile reset request with the victim's token and the attacker's number. A positive result is the OTP arriving on the attacker's phone and the victim's password being changeable.
-
The post closes with a tip credited to Bhavesh Thakur: intercept the request and put
email:victim mail%0d%0acc:hacker mail id. The server sends an email with the attacker's address in CC. A positive result is the CC copy arriving.
That last tip is worth unpacking. %0d%0a is the URL-encoded form of a carriage return followed by a line feed, the two characters that mark the end of a line in an email header. If a server pastes user input straight into an email header without cleaning it, those characters can end the current header and start a new one, here a cc: header that copies the message to the attacker. This is called email header injection. The author credits the tip to Bhavesh Thakur and links to his LinkedIn profile.
Glossary
- Account takeover: a bug that lets an attacker gain full control of someone else's account without knowing their password.
- Array: an ordered list of values in JSON, written with square brackets, for example
["a","b"]. - Bounty: the money a company pays a researcher for finding and reporting a valid security bug.
- Brute-forcing: trying many possible values, such as every possible OTP, until one works.
- Bug bounty hunting: testing websites for security bugs, usually with the company's permission, in exchange for a reward.
- Burp Suite: a tool that sits between your browser and a website so you can capture, inspect and modify requests before they are sent.
- CSRF (cross-site request forgery): a trick where a malicious site causes your browser to send a request to another site where you are already logged in.
- Duplicate: a bug report that matches one someone else already submitted, so it is not paid.
- Email header injection: inserting line-break characters into user input so that extra email headers, such as a CC, are added to a message the server sends.
- Forgot password feature: the part of a site that lets you regain access when you cannot remember your password, usually by emailing a reset link or sending a one-time code.
- HTTP parameter pollution: sending a parameter in an unexpected shape, such as a list instead of a single value, to see whether the server mishandles it.
- JSON: a text format for structured data made of labelled values, written with curly braces for objects and square brackets for lists.
- Low hanging fruit: an easy-to-find bug, often already reported by others.
- OTP (one-time password): a short code sent by email or text message that proves it is you, valid for one use.
- Parameter: a named piece of data sent in a request, such as an email address or a phone number.
- Recon (reconnaissance): mapping out what a website does and how data flows through it before testing it.
- Reset link: a special web address that lets whoever opens it set a new password for an account.
- Server-side validation: checks the server performs on data it receives, as opposed to checks the browser performs, which an attacker can bypass.
- Token: a random string the server issues to tie a request to a particular session or action, so it can tell the request is legitimate.
- Triaged: confirmed by the company's security team as a real issue and passed on for fixing.
- URL encoding: writing special characters in a web address or form value in a safe form, for example
%0d%0afor a carriage return and line feed.