Skip to content
Account takeover Write-up Beginner

Account Takeover Via Reset Password Worth 2000$

The password reset endpoint did not bind the authenticity token to the email address, so an attacker could change the email parameter to a victim's address and reset their password. This allowed full account takeover of any user.

Ashutosh mishra Follow

Published on ashutoshmishra00x0.medium.com

Bounty$2,000 View original

To People who don’t know me , I Ashutosh Mishra , 3rd Year Btech Computer Science Student, A cybersecurity Researcher by day and bug hunter by night,Mainly love to find Business logic bugs(Account Takeover and SSRF).

Ashutosh mishra, on ashutoshmishra00x0.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

This is a write-up about an account takeover found in the password reset flow of a financial website that ran a bug bounty program. The author refers to the target as redacted.com for security reasons. The feature involved is the standard "forgot password" mechanism: the application emails reset instructions to the address on the account, the user opens the link, and then submits a form to set a new password.

The author, Ashutosh Mishra (@ashutoshmish_ra), describes himself as a third-year B.Tech Computer Science student who focuses on business logic bugs, particularly account takeover and SSRF. This was his second account takeover write-up. The bug was found in December 2020, triaged on 11 February 2021, and rewarded with a $2000 bounty.

Account Takeover by #ashutoshmishra From the original on ashutoshmishra00x0.medium.com

Setup

The work was done against a single financial website enrolled in a bug bounty program. The tools mentioned are Burp Suite, used for spidering the site and intercepting requests, and a Burp Collaborator link, used to look for blind SSRF. The reset email arrived at a mailbox at [redacted], the address used in the password change request. No special role or privilege was needed: the precondition is simply a valid account of your own plus the email address of a victim account.

Finding it

The approach was to understand the application as a normal user first, then spider it with Burp Suite. The initial goal was SSRF. After three hours of hunting, no endpoint produced a successful SSRF. The author then moved to the registration and login pages, placing the Collaborator link in every request to look for blind SSRF, again without success.

From the original on ashutoshmishra00x0.medium.com

After around three days on the target he had found only minor issues that he did not consider worth reporting. On the login page there were two options: normal email and password, and OAuth. He tried to find OAuth misconfigurations, but the developers had implemented OAuth well. He then tried response manipulation on the email and password login, without success.

At 2 am, about to go to sleep, he decided to give the reset password mechanism one last try.

Exploitation

Step 1: Request the reset and inspect the response

The reset password flow sends email instructions to reset the password. While requesting the reset, he intercepted the request and its response, hoping the reset token would appear in the response. It did not.

Step 2: Open the emailed link and intercept the password change

He went to his mail, opened the reset link, and intercepted the request sent while changing the password. The request he saw is shown in the following screenshot.

From the original on ashutoshmishra00x0.medium.com

Two things stood out to him. First, no CSRF protection was implemented in the request. Second, he considered that the authenticity_token might be chained to the email address, in which case the absence of CSRF protection would be of no use to an attacker. To test whether the token and the email were linked, he changed the email from [redacted] to [redacted].

Step 3: Change the email parameter

This is the value he replaced with [redacted] in the intercepted password change request. The rest of the request, including the authenticity_token, was left as issued for his own account.

account takeover by #ashutoshmishra From the original on ashutoshmishra00x0.medium.com

Something happened that he describes as shocking: a notification appeared in the right corner claiming that the password had been reset.

Step 4: Confirm the takeover

To confirm, he tried to log in with the victim email address and his own new password. The login succeeded, which put him inside the victim account.

From the original on ashutoshmishra00x0.medium.com

Because the authentication token was not chained to the email address, changing the email parameter in the reset request let him set the password of any account.

Root cause

The password change request carried an authenticity_token but no CSRF protection, and the token was not chained to the email address. Changing the email parameter while keeping his own token resulted in the password being reset. The author's own framing is that there was "no chaining of authentication token with email address".

Impact

The author states this allowed account takeover of anyone.

Fix

The write-up does not describe what the vendor changed. The fix implied by the finding is to bind the authenticity_token to the email address it was issued for, and to reject the request when the email parameter does not match. CSRF protection should also be added to the password change request.

Variants to test

  1. Change the email or user identifier parameter in a password change request while keeping your own valid token. A positive result is a success notification and a login to the other account with your new password.
  2. Change the user identifier in other token-bearing requests, such as email change, MFA reset or profile update. A positive result is the change being applied to the other account.
  3. Test whether the reset token is single-use and expires, and whether it is accepted after the email parameter is altered. A positive result is the altered request being processed with the original token.
  4. Test the same parameter swap on API endpoints that accept a token in a header or body rather than a form field. A positive result is the action being performed against a different account than the token was issued for.

Timeline

Event Date
Bug reported 8 December 2020
Bug triaged 11 February 2021
Bounty rewarded $2000

The author's tip is to check whether a token is chained to an account by changing the parameter value.

account takeover by ashutosh mishra From the original on ashutoshmishra00x0.medium.com

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher found a way to take over anyone's account on a financial website that ran a bug bounty program. A bug bounty program is a deal offered by a company: if you find a security problem in their website and report it privately, they pay you a reward instead of punishing you. The researcher refers to the target as redacted.com to keep it anonymous.

The problem was in the "forgot password" feature. When you forget your password, a website usually emails you a link. You click the link, type a new password, and the site saves it. Behind the scenes, your browser sends a small form to the website saying "please set this new password". The researcher changed the email address in the password change form to another address, and the password was reset. He kept his own request, including its authenticity_token, and changed the email address to someone else's; the password was reset. He could then log in as that person.

He found it in December 2020. The company confirmed the bug on 11 February 2021 and paid him $2000.

Account Takeover by #ashutoshmishra From the original on ashutoshmishra00x0.medium.com

The image above is the article's title card, captioned Account Takeover by #ashutoshmishra.

The author introduces himself as a third-year B.Tech Computer Science student, a cybersecurity researcher by day and a bug hunter by night, who mainly looks for business logic bugs, especially account takeover and SSRF. This was his second account takeover write-up; the first one is linked from his article. He notes the bug was found three months before the write-up, in December 2020, while the response and the award came in February 2021.

Getting set up

Before touching any tool, it helps to know what the tools are for.

  • Burp Suite is a program that sits between your browser and a website. Every request your browser sends passes through it, and you can pause, read and edit that request before it reaches the site. It can also "spider" a site, which means automatically crawling links to map out all the pages it can find.
  • A request is the message your browser sends to a website, for example "please show me the login page" or "here is my new password, save it". A response is the website's reply.
  • SSRF (Server-Side Request Forgery) is a bug where you trick a website's own server into making a request to an address of your choosing. A Burp Collaborator link is a special web address that Burp controls; if the target server ever tries to visit it, Burp records the visit, which proves the server can be made to fetch addresses you supply. "Blind" SSRF means you never see the server's reply, only the fact that it made the request.
  • OAuth is a common way to log in to a site using another account, for example "Log in with Google".
  • Response manipulation is editing the reply a website sends back to your browser, to see whether the site's front end trusts it too much.

The reset email arrived at a mailbox at [redacted], the address used in the password change request. That is all the access he needed: a valid account of his own, plus the email address of a victim account.

How he found it

He started by using the site like a normal customer, to understand how it works, and then spidered it with Burp Suite. His first goal was SSRF. After three hours of hunting, no page produced a successful SSRF. He then moved to the registration and login pages, putting the Collaborator link into every request to look for blind SSRF, again without success.

From the original on ashutoshmishra00x0.medium.com

The screenshot above shows the point in the article where he describes trying the Collaborator link on the registration and login pages without success.

After around three days on the target he had found only minor issues that he did not think were worth reporting. On the login page there were two options: the normal email and password, and OAuth. He tried to find OAuth misconfigurations, but the developers had implemented OAuth well. He then tried response manipulation on the email and password login, without success.

At 2 am, about to go to sleep, he decided to give the reset password mechanism one last try.

Step by step

Step 1: Ask for a reset and watch the reply

The reset password feature works by emailing instructions to reset the password. While requesting the reset, he intercepted the request and its response, hoping the reset token would appear in the response. A reset token is a long random string that proves you are the person who received the reset email; it is normally embedded in the link. It did not appear in the response.

Step 2: Open the emailed link and intercept the password change

He went to his mail, opened the reset link, and intercepted the request sent while changing the password. The request he saw is shown in the following screenshot.

From the original on ashutoshmishra00x0.medium.com

The screenshot above shows the password change request he intercepted after opening the reset link from his mailbox.

Two things stood out to him. First, no CSRF protection was implemented in the request. CSRF (Cross-Site Request Forgery) is a class of attack where a malicious site makes your browser send a request to another site while you are logged in there, without you meaning to. Sites defend against it with a secret value that only their own pages know, so a request coming from elsewhere cannot include it. Second, he considered that the authenticity_token might be chained to the email address. An authenticity token is exactly that kind of secret value: a random string the site puts into its forms to prove the form came from the site itself. "Chained" here means tied to, or bound to: if the token were tied to the email address it was issued for, then the absence of CSRF protection would be of no use to an attacker, because a token stolen or reused for one account would not work for another. To test whether the token and the email were linked, he changed the email from [redacted] to [redacted].

Step 3: Change the email parameter

This is the value he replaced with [redacted] in the intercepted password change request. The rest of the request, including the authenticity_token, was left as issued for his own account.

Line by line, in plain words:

  • email=[redacted] is one field of the form the browser sends when you submit a new password. The name on the left of the = is the field name, and the value on the right is the email address of the account being changed. In the original request this was his own address, because he had started the reset for his own account.
  • He did not touch anything else. The authenticity_token in the request was still the one the site had given him for his own reset session. That is the heart of the test: if the site checks that the token belongs to the same account as the email address, the edited request should be rejected. If it does not check, the edited request will be accepted.
account takeover by #ashutoshmishra From the original on ashutoshmishra00x0.medium.com

The screenshot above is captioned account takeover by #ashutoshmishra and shows the moment after he changed the email address in the request.

Something happened that he describes as shocking: a notification appeared in the right corner claiming that the password had been reset.

Step 4: Confirm the takeover

To confirm, he tried to log in with the victim email address and his own new password. The login succeeded, which put him inside the victim account.

From the original on ashutoshmishra00x0.medium.com

The screenshot above shows the successful login into the victim account using the victim's email address and the researcher's new password.

Because the authentication token was not chained to the email address, changing the email parameter in the reset request let him set the password of any account.

Why it worked

The password change request carried an authenticity_token but no CSRF protection, and the token was not bound to the account whose password was being changed. Changing the email parameter while keeping his own token resulted in the password being reset. The author's own framing is that there was "no chaining of authentication token with email address".

A simple comparison: imagine a hotel reception that gives you a key card when you check in. The card should open only your room. Here, the card proved only that you were a guest at the hotel, and the room number was written on a sticky note you could rewrite yourself. Change the number, and the card opens someone else's room.

What an attacker could do

The author states this allowed account takeover of anyone.

How to fix it

The write-up does not describe what the vendor changed. The fix implied by the finding is to bind the authenticity_token to the email address it was issued for, and to reject the request when the email parameter does not match. CSRF protection should also be added to the password change request.

Other places to try the same idea

  1. Change the email or user identifier parameter in a password change request while keeping your own valid token. A positive result is a success notification and a login to the other account with your new password.
  2. Change the user identifier in other token-bearing requests, such as email change, MFA reset or profile update. A positive result is the change being applied to the other account.
  3. Test whether the reset token is single-use and expires, and whether it is accepted after the email parameter is altered. A positive result is the altered request being processed with the original token.
  4. Test the same parameter swap on API endpoints that accept a token in a header or body rather than a form field. An API endpoint is a web address that a program, rather than a person clicking links, talks to; it accepts data and returns data. A positive result is the action being performed against a different account than the token was issued for.

Timeline

Event Date
Bug reported 8 December 2020
Bug triaged 11 February 2021
Bounty rewarded $2000

"Triaged" means the company's security team reviewed the report, confirmed the bug is real, and passed it on to be fixed.

The author's tip is to check whether a token is chained to an account by changing the parameter value.

account takeover by ashutosh mishra From the original on ashutoshmishra00x0.medium.com

The final image is captioned account takeover by ashutosh mishra and sits under the heading PROOF, alongside the timeline and the tip.

Glossary

  • Account takeover: a bug that lets an attacker log in as another person and control their account.
  • API endpoint: a web address that programs talk to, sending and receiving data, rather than a page a person clicks through.
  • Authenticity token: a random secret value a website puts into its forms to prove the form came from the site itself, used as a defence against CSRF.
  • Blind SSRF: SSRF where you cannot see the server's reply, only evidence that the server made the request.
  • Bug bounty program: a scheme where a company pays researchers who privately report security problems in its systems.
  • Burp Collaborator link: a web address controlled by Burp Suite that records any visit to it, used to detect blind SSRF.
  • Burp Suite: a tool that sits between your browser and a website so you can pause, read and edit requests and responses, and crawl a site.
  • Chained (bound): tied to a particular account or value, so it cannot be reused for a different one.
  • CSRF (Cross-Site Request Forgery): an attack where a malicious site makes your browser send a request to another site while you are logged in there, without your intent.
  • CSRF protection: a defence against CSRF, typically a secret value that only the site's own pages know.
  • MFA reset: the process of turning off or re-enrolling multi-factor authentication, the extra login step beyond a password.
  • OAuth: a way to log in to a site using an account from another service, for example "Log in with Google".
  • Parameter: a named field in a request, written as name=value, whose value the server reads and acts on.
  • Request: the message your browser sends to a website.
  • Response: the website's reply to a request.
  • Response manipulation: editing the reply a website sends back to your browser to see whether the site's front end trusts it too much.
  • Reset token: a long random string, usually inside the emailed reset link, that proves you received the reset email.
  • Spidering: automatically crawling a website's links to map out its pages.
  • SSRF (Server-Side Request Forgery): a bug where you trick a website's server into making a request to an address of your choosing.
  • Triaged: reviewed and confirmed as a real bug by the company's security team.

More by Ashutosh mishra

View all

1 more disclosed report, 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.