Skip to content
Account takeover Write-up Beginner

Tricky 2FA Bypass Leads to 4 digit Bounty $$$$

The password reset flow did not require the second factor, so after resetting the password an attacker could log in without the 2FA code. This allowed bypassing two-factor authentication.

Rohaangupta Follow

Published on medium.com

Bounty$1,000 View original

{{media:0}}

Rohaangupta, 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.

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. 3 min read.

Context

This write-up describes a two-factor authentication bypass found on a private Bugcrowd program. The author, Rohan Gupta, presents himself as a part-time bug hunter and full-time junior security analyst. The report does not name the target, the product or the affected endpoint; the reproduction steps refer only to a placeholder, http://domain.com.

The feature involved is standard 2FA: after a user enables a second factor through an authenticator app, the login flow is supposed to require that factor in addition to the password. The author opens with a short explanation of why that matters: 2FA adds a second factor beyond the password, so a stolen or phished password alone is not enough to reach the account, and credentials exposed in a data breach cannot be used on their own.

Rohaangupta
Rohaangupta From the original on medium.com

Setup

The only precondition is an ordinary user account on the target with 2FA enabled through an authenticator app. No special role, tool or version is mentioned. The researcher needed access to the account's own settings (to enable 2FA) and to the unauthenticated password reset flow.

Finding it

The researcher does not describe how the issue was first noticed. What the report shows is the outcome of combining two flows that are normally independent: the password reset flow and the login flow. After a password reset, the account could be accessed without presenting the second factor, even though 2FA had been enabled on it beforehand.

Exploitation

The reproduction is given as a numbered sequence. The report shows no HTTP requests, responses, headers or parameters, so the steps below are exactly the actions described, without invented traffic.

Step 1: Create an account

Register a normal account on the target, referred to in the report as http://domain.com.

Step 2: Enable 2FA

Turn on two-factor authentication for the account using an authenticator app. At this point the account is protected by a second factor in the normal login flow.

Step 3: Log out

End the session, so the following steps start from an unauthenticated state.

Step 4: Go to the forgot password page

Open the password recovery flow as an unauthenticated user.

Step 5: Reset the password

Complete the reset so that a new password is set for the account.

Step 6: Save the new password

Change the password and click on Save changes.

Step 7: Log in without the second factor

After the reset, the researcher observed that the attacker could log in without 2FA. The report states this plainly: "It was observed that without 2FA attacker was able to login".

It also does not describe any server response.

Root cause

The report does not analyse the code. Based on the behaviour, the likely cause is that the password reset flow does not preserve the account's 2FA state: completing a reset either clears the second-factor requirement or issues an authenticated session without checking it. The existing defence, the 2FA challenge at login, is simply not applied on the path that follows a reset, so the second factor is never requested.

Impact

An attacker who can complete the password reset for an account can reach that account without the second factor, which defeats the purpose of enabling 2FA.

Fix

A reasonable remediation, not stated in the report, is to keep the 2FA requirement intact across the reset flow, so that a successful password reset does not by itself produce an authenticated session and the second factor is still demanded before access is granted.

Variants to test

  1. Reset the password on a 2FA-protected account and then attempt login: a positive result is a session or account access obtained without the authenticator code.
  2. Check whether the reset response itself sets an authenticated session: a positive result is a usable session cookie returned by the reset request.
  3. Try the same sequence with other second factors (for example, email or SMS codes) if the target supports them: a positive result is the same bypass on a different factor.
  4. Test other account-recovery paths, such as changing the email address or unlinking a factor: a positive result is any path that ends in account access without the second factor.

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. 5 min read.

What happened, in plain words

A security researcher found a way to get into an account that was protected by two-factor authentication (2FA) without ever providing the second factor. He did this by using the "forgot password" feature. After resetting the password, the account could be accessed with just the new password, even though 2FA had been turned on. The researcher reported it to a private bug bounty program on Bugcrowd and was paid a bounty. This article explains the whole story in simple terms, including what 2FA is, why it matters, and how the bypass worked.

Rohaangupta
Rohaangupta From the original on medium.com

What is 2FA and why do we need it?

2FA stands for "Two-Factor Authentication." It is a security process that asks for two different proofs of identity before letting you into a system, account, or app. The first factor is usually something you know, like a password. The second factor is something you have, like a code from an authenticator app on your phone, or something you are, like a fingerprint. The goal is to add an extra layer of security beyond just a username and password.

Why is that important? Here are the reasons the researcher gives:

  1. Enhanced Security: Passwords can be stolen or guessed. With 2FA, an attacker also needs the second factor, which is much harder to get.
  2. Protection Against Password Theft: Even if someone steals your password, they cannot log in without the second factor.
  3. Mitigating Phishing Attacks: Phishing tricks you into entering your password on a fake site. With 2FA, the attacker still lacks the second factor.
  4. Reducing the Impact of Data Breaches: If a company's database is breached and passwords leak, 2FA still protects your account.
  5. Peace of Mind: Knowing your accounts are protected makes you less worried about unauthorised access.

In short, 2FA adds a step to login, but the security benefits are worth it.

The vulnerability

The researcher found a bug on a private program on Bugcrowd. He does not name the target; he uses http://domain.com as a placeholder. The bug is a 2FA bypass: a way to get into an account without providing the second factor. This defeats the purpose of 2FA.

Steps to reproduce

The researcher gave these steps. I will explain each one and why it was done.

  1. Create an account on http://domain.com

    • This sets up a normal user account. You need an account to test the login and password reset flows.
  2. Enable the 2FA via authenticator app

    • Turn on two-factor authentication for the account. An authenticator app generates codes for the second factor. After this step, logging in normally should require both the password and a code from the app.
  3. Now logout the account

    • Logging out ends your session. This is important because the next steps must be done as an unauthenticated user, just like an attacker would.
  4. Goto forgot password page

    • Open the password recovery page. This is a common feature that lets users reset their password if they forget it. It usually asks for your email address and sends a reset link.
  5. Reset password

    • Complete the password reset process. This typically involves clicking a link in an email and setting a new password.
  6. Change the password and click on Save changes

    • Set a new password and save it. At this point, the account's password is changed.
  7. It was observed that without 2FA attacker was able to login

    • After the reset, the researcher found that he could log in without being asked for the 2FA code. This is the bypass: the second factor was skipped.

The report does not show any HTTP requests, responses, headers, or parameters. It only describes the actions. So we cannot see exactly what was sent to the server.

Why did this happen?

The report does not analyse the code, but we can make an educated guess. The password reset flow likely does not properly maintain the 2FA requirement. When you reset your password, the system might either clear the 2FA setting or create a logged-in session without checking for the second factor. In other words, the 2FA check is missing on the path that follows a password reset.

Impact

An attacker who can reset the password of an account can then access that account without the second factor. This completely bypasses 2FA. However, the report does not say what is needed to reset the password (for example, access to the account's email). So the real-world risk depends on that. The researcher was rewarded for this finding.

How to fix it

A sensible fix would be to ensure that after a password reset, the system still requires the second factor before granting access. For example, after resetting the password, the user should be prompted for the 2FA code before being logged in.

Variants to test

If you want to look for similar bugs, here are some ideas:

  1. Reset the password on a 2FA-protected account and then try to log in. If you get in without the code, it's a bypass.
  2. Check if the password reset response itself sets a session cookie. If it does, you might be logged in without 2FA.
  3. Try the same with other second factors (email codes, SMS codes) if the site supports them.
  4. Test other account recovery paths, like changing the email address or unlinking a factor. Any path that ends in account access without the second factor is a bug.

Glossary

  • 2FA (Two-Factor Authentication): A security process that requires two different forms of identification before granting access.
  • Authenticator app: A mobile app that generates time-based codes for 2FA.
  • Bug bounty program: A program where organisations reward researchers for finding and reporting security vulnerabilities.
  • Bugcrowd: A platform that hosts bug bounty programs.
  • Bypass: A way to get around a security control.
  • Password reset flow: The process of recovering a forgotten password, usually via email.
  • Session: A period of interaction between a user and a system, often maintained by a cookie.
  • Cookie: A small piece of data stored by the browser that can keep you logged in.
  • Unauthenticated: Not logged in.
  • Endpoint: A specific URL where an API or web service can be accessed.
  • API: Application Programming Interface; a set of rules that allows software to communicate.
  • HTTP request/response: The format of communication between a browser and a server.
  • Header: Part of an HTTP request or response that carries metadata.
  • Parameter: A piece of data sent in a request, often in the URL or body.
  • Root cause: The underlying reason why a vulnerability exists.
  • Remediation: The fix for a vulnerability.
  • Variant: A variation of a vulnerability that might exist in other parts of the system.

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.