How a Simple Reset Password Button Bypassed 2FA Entirely
The application's password reset flow, when triggered from the 2FA prompt, incorrectly elevated the user's session to fully authenticated. An attacker who knew a victim's password could bypass the second factor and access the account without entering an OTP.
medium.com
Published on medium.com
Cybersecurity
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 is described only as "a target" tested during a bug bounty engagement; the report does not name the application, the program or the platform. The feature under test is the standard password login flow with a second factor: a user submits an email and password at /login, and the application then holds the user at a 2FA prompt at /verify-2fa until a one-time code is supplied. The authenticated area behind that gate is /dashboard.
Normally the flow works as intended: correct primary credentials move the session into a pending, unauthenticated state, and only a valid OTP promotes it to fully authenticated. The report describes a logic flaw in which a different, legitimate feature, the password reset request, moves the session to the authenticated state without any OTP being checked.

The author notes that the report was closed as a Duplicate, so the write-up is about the technique rather than a paid finding.
Setup
The report gives no tooling, no account roles and no version information. The only preconditions visible from the narrative are:
- A valid account on the target with a known email address and password.
- That account protected by 2FA, so that a correct password alone lands on
/verify-2fa. - Access to the login page, from which the "Forgot Password?" link is reachable.
No intercepting proxy, macro or automation is mentioned; the author explicitly says afterwards that logic flaws like this do not always need complex payloads, Burp macros or automated tools.
Finding it
The author was mapping the login flow and confirmed the expected behaviour:
- Go to
/login. - Submit the primary credentials (
email+password). - The application stops the login and asks for the 2FA code at
/verify-2fa.
On the 2FA prompt screen there is a small "Forgot Password?" link. That link is the interesting part: it is a normal, intended feature, but it is reachable from a session that is half-way through authentication. The question the author asked was how the backend tracks the current state of that half-authenticated session, and whether triggering the reset flow changes it.
Exploitation
Step 1: reach the 2FA prompt with valid primary credentials
Submit the email and password at /login. The application responds by presenting the 2FA prompt at /verify-2fa instead of the dashboard. At this point the session is supposed to be pending and unauthenticated.
Step 2: click "Reset Password" instead of entering the OTP
From the 2FA prompt, follow the "Forgot Password?" link and use the reset password functionality rather than typing a code. No OTP is entered at any point.
Step 3: request the reset email
Enter the same email address again and submit the form. The application returns a standard confirmation message:
Password reset email sent!
Step 4: go straight to the dashboard
Without opening the email and without clicking the reset link inside it, navigate to /dashboard. The application serves the authenticated dashboard: the session is fully logged in, with no 2FA code and no OTP validation having taken place.
The key detail is that the reset link in the email was never used. The mere act of requesting the reset, from the pending session, was enough to change that session's state.
Root cause
The author classifies this as a Business Logic and State Management Flaw. After a correct password the backend knows step one succeeded, but it is supposed to keep the session in a temporary, unauthenticated state until step two (2FA) passes. When the password reset is requested from that screen, the backend mishandles the state: instead of leaving the session pending, or clearing it, the reset flow causes the backend to elevate the session status to "Fully Authenticated".
In the author's words, the server assumed that because the requester owned the email box used to request a reset, they were good to go. The author's explanation is that the reset flow caused the backend to elevate the session status to "Fully Authenticated" instead of keeping it pending or clearing it.
The 2FA gate on /verify-2fa was bypassed because the reset flow changed the session state without an OTP being checked.
Impact
With a valid email address and password, the first login step can be completed, a reset requested, and /dashboard reached without any OTP. In the tested flow, the password alone was sufficient to reach the dashboard.
The condition is that the attacker must already hold valid primary credentials, so this does not help against an account whose password is unknown. The report does not describe any further actions taken once inside the dashboard, and does not state whether the reset email itself had to be deliverable for the bypass to work; in the author's test the email was never opened.
Fix
Based on the described root cause, the reset request handler should not promote a session that has not passed 2FA: it should either leave the session in its pending state or invalidate it, and the authenticated state should only be set after the OTP check succeeds.
Variants to test
- Other features reachable from the 2FA prompt. Try any link or form available on
/verify-2fa(resend code, change email, support, logout) and then request an authenticated page. A positive result is being served authenticated content without submitting an OTP. - Password reset request from a pending session, then a different authenticated endpoint. Repeat the flow but request a page other than
/dashboard, such as a profile or settings page. A positive result is any authenticated response without OTP validation. - Reset request with a different email address. Submit the reset form with another address while the session is pending. A positive result is the pending session becoming authenticated, which would show the state change is not tied to the account being reset.
- Registration or email-change flows from a pending session. Trigger account creation or an email change request mid-login. A positive result is the same promotion to an authenticated session.
- Session fixation style checks. Note the session identifier before and after the reset request. A positive result is the same identifier being reused with elevated privileges, which would confirm the state flag is being flipped on an existing session rather than a new one being issued.
What happened, in plain words
A security researcher was testing a website that protects accounts with two steps at login: first your email and password, then a short one-time code (often called 2FA, or two-factor authentication). The idea is that even if someone steals your password, they still cannot get in without the code.
The researcher found that the second step could be skipped entirely. After typing a correct email and password, the site asked for the code. Instead of typing it, the researcher clicked the site's ordinary "Forgot Password?" link, asked for a password reset email, and then went straight to the logged-in area of the site. The site let them in, fully logged in, without any code ever being entered. The reset email was never even opened.
This is a logic flaw: every individual feature worked as designed, but the way they were wired together let someone walk around the locked door. The researcher's report was marked as a duplicate, meaning someone else had already reported the same bug, so this write-up is about the technique.

The pieces you need to know first
Before walking through the steps, here are the basic ideas the story relies on. None of them require any special software; a normal browser is enough.
- A web application: a program that runs on a company's server and that you use through your browser. When you click a button, your browser sends a request over the internet, the server decides what to do, and it sends back a page or a message.
- An endpoint: a specific address (a URL path) on that server that does one job. Think of a building with many numbered counters:
/loginis the counter where you sign in,/verify-2fais the counter where you hand over your code,/dashboardis the room you are only allowed into once you are signed in. The report names exactly these three paths. - A session: the server's memory of "who is this person across several requests?". Your browser and the server pass a small piece of data back and forth (usually stored in a cookie, a tiny note your browser keeps for a site) so the server can recognise you on the next click. Without a session, the server would forget you the moment a page finished loading.
- Session state: the label the server attaches to that session. In this story the important labels are "pending" (password was correct, but the code has not been checked yet) and "fully authenticated" (this person has passed every check). The whole bug is about that label being changed at the wrong moment.
- 2FA / OTP: two-factor authentication, a second proof of identity beyond the password. The second proof is usually an OTP, a one-time password: a short code that is valid once and expires quickly, sent by text, email or an app. The point is that a stolen password alone is not enough.
- A password reset flow: the "forgot my password" feature. You give the site your email address, it sends you an email containing a special link, and opening that link lets you set a new password. It exists so that people who forget their password are not locked out forever.
- A logic flaw (business logic and state management flaw): a bug where nothing crashes and no strange input is needed. Each feature behaves as its author intended, but the rules connecting them are wrong, so a user can do something the designer never imagined. Compare it to a hotel where the front desk checks your ID before giving you a room key, but the laundry room door also hands out room keys to anyone who asks nicely.
- A duplicate: when you report a bug and the platform tells you someone else already reported the same one. You get no reward, but you know you found something real.
The setup
The report does not name the website, the company or the bug bounty platform, and it gives no software versions or tools. The only things needed to follow along are:
- A valid account on the target site, with a known email address and password.
- That account protected by 2FA, so that a correct password alone lands you on
/verify-2farather than inside the site. - Access to the login page, from which the "Forgot Password?" link can be reached.
No intercepting proxy (a tool that lets you pause and edit requests between browser and server), no macros and no automation are mentioned. The author says afterwards that logic flaws like this do not always need complex payloads, Burp macros or automated tools.
Finding it
The researcher first walked through the login flow the normal way, to confirm it behaved as expected:
- Go to
/login. - Type in the primary credentials (
email+password). - The application stops the login and asks for the 2FA code at
/verify-2fa.
So far the front door is locked properly. The interesting detail is on the 2FA prompt screen itself: a small "Forgot Password?" link. That link is a normal, intended feature, but it is reachable from a session that is only half-way through logging in. The question the researcher asked was: how does the server keep track of the state of that half-finished session, and does using the reset feature change it?
Exploitation
Step 1: reach the 2FA prompt with valid primary credentials
Submit the email and password at /login. The application responds by showing the 2FA prompt at /verify-2fa instead of the dashboard. At this point the session is supposed to be pending and unauthenticated: the server has noted that the password was right, but has not yet accepted that the person is who they claim to be.
Step 2: click "Reset Password" instead of entering the OTP
From the 2FA prompt, follow the "Forgot Password?" link and use the reset password functionality rather than typing a code. No OTP is entered at any point. The reason for trying this is that the reset feature also has to touch the session, and any feature that touches the session is a candidate for changing its state by accident.
Step 3: request the reset email
Enter the same email address again and submit the form. The application returns a standard confirmation message:
Password reset email sent!
This is the ordinary message any user sees after asking for a reset. Nothing in it looks unusual. The important part is what happened on the server behind it: the reset request was processed while the session was still pending.
Step 4: go straight to the dashboard
Without opening the email and without clicking the reset link inside it, navigate to /dashboard. The application serves the authenticated dashboard: the session is fully logged in, with no 2FA code and no OTP validation having taken place.
The key detail is that the reset link in the email was never used. The mere act of requesting the reset, from the pending session, was enough to change that session's state.
Why it worked
The author classifies this as a business logic and state management flaw. After a correct password the server knows step one succeeded, but it is supposed to keep the session in a temporary, unauthenticated state until step two (2FA) passes. When the password reset is requested from that screen, the server mishandles the state: instead of leaving the session pending, or clearing it, the reset flow causes the server to elevate the session status to "fully authenticated".
In the author's words, the server assumed that because the requester owned the email box used to request a reset, they were good to go. The author's explanation is that the reset flow caused the server to elevate the session status to "fully authenticated" instead of keeping it pending or clearing it.
The 2FA gate on /verify-2fa was bypassed because the reset flow changed the session state without an OTP being checked.
What an attacker could do with it
With a valid email address and password, the first login step can be completed, a reset requested, and /dashboard reached without any OTP. In the tested flow, the password alone was sufficient to reach the dashboard.
The condition is that the attacker must already hold valid primary credentials, so this does not help against an account whose password is unknown. The report does not describe any further actions taken once inside the dashboard, and does not state whether the reset email itself had to be deliverable for the bypass to work; in the author's test the email was never opened.
How it should be fixed
Based on the described root cause, the reset request handler should not promote a session that has not passed 2FA: it should either leave the session in its pending state or invalidate it, and the authenticated state should only be set after the OTP check succeeds.
Other places to try the same idea
Once you understand the pattern, you can look for it elsewhere. Each item below is a variation on the same question: can a feature that is reachable before 2FA is finished change the state of the session?
- Other features reachable from the 2FA prompt. Try any link or form available on
/verify-2fa(resend code, change email, support, logout) and then request an authenticated page. A positive result is being served authenticated content without submitting an OTP. - Password reset request from a pending session, then a different authenticated endpoint. Repeat the flow but request a page other than
/dashboard, such as a profile or settings page. A positive result is any authenticated response without OTP validation. - Reset request with a different email address. Submit the reset form with another address while the session is pending. A positive result is the pending session becoming authenticated, which would show the state change is not tied to the account being reset.
- Registration or email-change flows from a pending session. Trigger account creation or an email change request mid-login. A positive result is the same promotion to an authenticated session.
- Session fixation style checks. Note the session identifier before and after the reset request. A positive result is the same identifier being reused with elevated privileges, which would confirm the state flag is being flipped on an existing session rather than a new one being issued.
Glossary
- 2FA (two-factor authentication): a login that needs two different proofs, usually a password plus a one-time code.
- OTP (one-time password): a short code valid for a single use and a short time, used as the second proof.
- Endpoint: a specific URL path on a server that performs one job, such as
/loginor/dashboard. - Session: the server's memory of who you are across several requests, kept alive by data your browser sends back each time.
- Cookie: a small piece of data a site stores in your browser and receives back on later requests, commonly used to identify a session.
- Session state: the label the server attaches to a session, for example pending (password checked, code not yet checked) or fully authenticated.
- Pending session: a session where the password was correct but the second factor has not been verified yet.
- Password reset flow: the "forgot password" feature that emails a link allowing you to set a new password.
- Logic flaw (business logic and state management flaw): a bug where each feature works as designed but the rules between them are wrong, letting a user do something unintended.
- Duplicate: a bug report that matches one already submitted, so no reward is given.
- Bug bounty: a programme where organisations pay researchers for reporting security bugs responsibly.
- Intercepting proxy: a tool that sits between browser and server so requests can be paused, inspected and edited.
- Burp macro: a saved sequence of requests in the Burp Suite proxy tool that can be replayed automatically.
- Payload: the crafted input sent to a server to trigger a bug.
- Session fixation: an attack pattern where an attacker causes a victim to use a session identifier the attacker already knows; checking whether an identifier survives a privilege change is a way to spot related weaknesses.