Skip to content
Account takeover Write-up Beginner

Bypass 2FA in a website

The password reset flow required a 2FA code, but the server did not enforce its presence. An attacker who knew a victim's email could reset the password by omitting the 2FA token parameter from the request, gaining account access.

Sourav Sahana Follow

Published on medium.com

Hii hunters ! I’m again with another story.

Sourav Sahana, on 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.

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 server treated the 2FA token as optional and did not verify it was present and correct before completing the password reset.

Impact

An attacker could reset the password of any account and log in without the 2FA code, leading to account takeover.

What the attacker needed

Victim's email address; access to the reset link sent to that email

How it was found

  1. Go to the forgot password page and enter the victim's email address.
  2. Open the reset link from the email and enter a new password.
  3. When the 2FA code prompt appears, intercept the POST request.
  4. Remove the token parameter and its value from the request body.
  5. Forward the request; the password is changed and the account is accessed.

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.

Two-factor authentication (2FA) is a second check, like a code from an app, on top of a password. Here the website asked for that code during a password reset but did not actually check that it was sent. By removing the code from the request, the reset went through without it, so someone could take over an 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.

More by Sourav Sahana

View all

4 more disclosed reports, 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.