How a Re-Authentication Feature Unintentionally Bypassed 2FA Entirely 🔓
An application's re-authentication prompt for an expired session accepted only the primary password and then marked the whole session as fully authenticated, without checking whether the account had 2FA enabled. An attacker who knew the password could therefore reach the entire application without ever supplying a 2FA code.
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 was an application that enforced two-factor authentication for sensitive account actions and for logins. Alongside that, it offered a common usability feature: when a session had been inactive or had partially expired, navigating straight to a sensitive internal endpoint such as /settings did not immediately send the user back to the full login page. Instead, the application showed a re-authentication prompt that asked only for the primary password to confirm identity before granting access to settings.
That prompt is the feature at the centre of this write-up. It is meant to be a lightweight confirmation step for a user who is already known to the application. The question the researcher asked was whether that lightweight step could stand in for the full authentication pipeline, including 2FA.

The report was ultimately closed as a duplicate, but the execution path and root cause are still worth walking through as a case study in session state management.
Setup
The preconditions it does state are simple:
- An account with 2FA enabled.
- A session that has been logged out or left inactive for an extended period, described in the report as up to a month.
- The ability to navigate directly to a restricted URL rather than following the normal login flow.
No special payloads, proxies or custom tooling are mentioned. The whole finding rests on how the application handles user state.
Finding it
What made the behaviour look wrong was the mismatch between two authentication paths. The standard path is /login, where the user supplies credentials and then a 2FA OTP. The re-authentication path is the prompt shown when an expired or partial session hits a sensitive endpoint, and it asks for the primary password only.
If both paths end with the same session state, then the shorter path is a way around the longer one. The researcher noticed that the re-authentication prompt did exactly that: after a correct password it did not merely unlock the requested page, it marked the session as fully authenticated for the whole application. From that point the 2FA step was never requested again.
Exploitation
Step 1: Start from an expired or inactive session
Assume an account has 2FA enabled. The user logs out, or leaves the browser session inactive for an extended period, even up to a month. The important detail is that the server does not fully destroy the long-lived session cookie; the session is left in a partial or expired state rather than being removed outright.
Step 2: Navigate directly to a restricted URL
Instead of visiting /login and going through the standard credentials plus 2FA flow, the user navigates directly to a restricted URL:
https://target.com/settings
Skipping /login is the whole point. The normal login flow is where the OTP challenge lives, so the attacker avoids it entirely and approaches a sensitive endpoint with whatever session state the browser still holds.
Step 3: Trigger the re-authentication prompt
The backend recognises the expired or partial session token and halts full access. Rather than redirecting to the full login page, it redirects to a prompt reading:
Please enter your password to continue to Settings.
At this stage the application has decided that the visitor is a known user who needs to confirm identity, not an unauthenticated stranger who needs to log in from scratch.
Step 4: Supply the primary password
The user enters the primary account password. The server validates it, grants access to /settings, and at the same time updates the session state to Fully Authenticated. No OTP is requested at any point in this exchange.
Step 5: Use the elevated session across the application
From that moment the user can browse the entire application, including Dashboard, Profile, Billing and internal actions, without ever being prompted for a 2FA OTP token. The narrow confirmation for one page has become a global authentication state.
Root cause
The report describes the issue as inadequate state verification during privilege elevation, a re-authentication flaw. Two design decisions combine to produce it.
- Partial session retention. The application does not completely invalidate and destroy long-lived session cookies on the server side after expiration. A stale token remains in a semi-active state that still accepts the re-authentication shortcut.
- Flawed state transition. When the user supplies the correct password at the
/settingsprompt, the backend logic treats identity verification as complete. It refreshes the session flag toAUTHENTICATED=TRUEacross the entire application context, without checking whether the account has 2FA enabled (IS_2FA_VERIFIED).
In short, the application treats a quick password check as an absolute substitute for the entire multi-factor authentication pipeline. The re-authentication path did not check whether the account had 2FA enabled, so the second factor was skipped.
Impact
A user who holds the primary password of a 2FA-protected account, but not the second factor, can obtain a fully authenticated session. The conditions are that the account has 2FA enabled and that a partial or expired session token for that account is still present and accepted by the server, for example after the legitimate user logged out or left the session inactive for an extended period.
Once the password is entered at the re-authentication prompt, the attacker reaches the whole application, including Dashboard, Profile, Billing and internal actions, without an OTP. The practical effect is that the second factor is never requested in this scenario.
The report does not give a severity rating, a CVSS score or a bounty amount, and the finding was a duplicate.
Fix
The report lists three remediations.
- Enforce unified auth checks. Any action or prompt that elevates a session from expired or unverified to fully authenticated must evaluate all required authentication factors, password plus 2FA.
- Strict session invalidation. Invalidate and clear stale session tokens completely on timeout, rather than leaving them in a semi-active state that accepts re-authentication shortcuts.
- Contextual permissions. Re-authentication prompts for sensitive actions should grant narrow, localised permissions rather than elevating the global session state.
Variants to test
- Other sensitive endpoints behind a re-auth prompt. Try direct navigation to endpoints such as billing, email change or API key management while holding an expired session. A positive result is a password-only prompt that, once satisfied, leaves the session able to reach unrelated areas of the application.
- Password change and email change flows. These often ask for the current password as confirmation. Check whether completing them also flips the session to fully authenticated. A positive result is that a subsequent visit to a 2FA-gated page no longer asks for an OTP.
- Remember-me and long-lived cookies. Log out, then replay the old session cookie against a sensitive endpoint. A positive result is that the server accepts the stale token and offers the re-authentication prompt instead of rejecting the session.
- Step-up prompts on API routes. Repeat the same direct navigation against JSON or API endpoints rather than HTML pages. A positive result is a response that returns data or a new session token after only the password, with no OTP challenge.
- Session flag inspection. Compare the session state before and after the re-authentication prompt, for example by observing which pages become reachable. A positive result is that pages which previously redirected to login or to the OTP step now load directly.
What happened, in plain words
Imagine a bank with two doors. The front door asks for your card and your PIN. The side door, used when you come back after a long break, only asks for your card. If the side door quietly unlocks the whole building, the PIN stops mattering. That is essentially what this report describes, but for a website account protected by two-factor authentication.
Two-factor authentication, usually shortened to 2FA, means logging in needs two different things: something you know (your password) and something you have or can read (a one-time code, often called an OTP, sent to your phone or generated by an app). The idea is that a stolen password alone is not enough to get in.
The application in this report enforced 2FA for logins and for sensitive account actions. It also had a convenience feature: if your session had gone inactive or partly expired, going straight to a sensitive page such as /settings did not throw you back to the full login page. Instead it showed a small prompt asking only for your main password, to confirm it was really you before letting you into settings.
That small prompt is the feature at the centre of the story. It is meant to be a light confirmation for someone the application already knows. The researcher asked a simple question: can this light step stand in for the full login process, including the 2FA code? The answer was yes. After the correct password, the application did not just unlock the settings page, it marked the whole session as fully logged in, and the 2FA step was never asked for again.
The report was a duplicate. Even so, the path and the underlying cause are a useful lesson in how websites track whether you are logged in.

The pieces you need to know first
Before walking through the steps, a few everyday ideas from how websites work.
Session and session cookie. When you log in, the server needs a way to remember you on the next page load. It gives your browser a small piece of data, stored in a cookie, often called a session token. Your browser sends it back with every request, and the server looks it up to decide who you are. Think of it as a cloakroom ticket: the ticket itself is not your coat, but it lets the attendant find your coat.
Session state. The server keeps a note about how far your login has got. It might be "not logged in", "password checked but not the second factor", or "fully logged in". This note is the session state, and the whole bug lives in how that note gets changed.
Endpoint and URL. An endpoint is a specific address on a website that does one job, such as showing your settings or saving a change. /settings is an endpoint. Navigating directly to a URL means typing or pasting the address into the browser instead of clicking through the site's normal menus and login pages.
API. An API is the same idea without the pretty pages: a way for software to ask the server for data or actions, usually returning raw data rather than a web page.
Re-authentication. This is the "are you still you?" prompt. Many sites ask for your password again before a sensitive change, even while you are logged in. It is a confirmation step, not a fresh login.
Logic flaw. Most security bugs involve breaking something technical, like injecting code. A logic flaw is different: every piece works as designed, but the design lets you do something it should not. It is like a form that accepts a negative quantity because nobody thought to check.
Privilege elevation. Raising what an account is allowed to do, or how trusted it is. Logging in fully is an elevation from "unknown visitor" to "account owner".
Duplicate. A bug report closed because the same issue was already submitted by someone else. It still counts as a real finding.
Setting up the situation
What it does state are three preconditions:
- An account with 2FA enabled.
- A session that has been logged out or left inactive for a long time, described in the report as up to a month.
- The ability to navigate directly to a restricted URL rather than following the normal login flow.
No special payloads, proxies or custom tools are mentioned. The whole finding rests on how the application handles user state. That is worth pausing on: you do not need to be a programmer to understand it, because nothing is being broken or injected. The website is simply being asked to do something in an order it did not expect.
Finding it
What made the behaviour look wrong was the mismatch between two ways of proving who you are.
The standard path is /login. There, you supply your username and password, and then a 2FA one-time code. Only after both does the site consider you fully logged in.
The re-authentication path is the prompt shown when an expired or partial session reaches a sensitive page. It asks for the main password only.
If both paths end with the same session state, then the shorter path is a way around the longer one. The researcher noticed that the re-authentication prompt did exactly that: after a correct password it did not merely unlock the requested page, it marked the session as fully authenticated for the whole application. From that point the 2FA step was never requested again.
In plain terms: the site had two doors, one with two locks and one with a single lock, and the single-lock door opened every room in the building.
Walking through the steps
Step 1: Start from an expired or inactive session
Assume an account has 2FA enabled. The user logs out, or leaves the browser session inactive for a long time, even up to a month.
The important detail is that the server does not fully destroy the long-lived session cookie. The session is left in a partial or expired state rather than being removed outright. Think of a hotel key card that stops opening your room but is still recognised by the front desk as belonging to a guest. The report's point is that the old ticket still exists on the server and is still accepted for something.
Why start here? Because the whole bug depends on the application believing it already knows you, just not enough. A completely unknown visitor would be sent to the full login page, 2FA included. A half-known visitor gets the shortcut.
Step 2: Navigate directly to a restricted URL
Instead of visiting /login and going through the standard credentials plus 2FA flow, the user navigates directly to a restricted URL:
https://target.com/settings
Line by line, there is only one line, and it is a web address. https:// is the normal secure web protocol. target.com stands in for the site's domain name, the site's address on the internet. /settings is the path to the account settings page.
Skipping /login is the whole point. The normal login flow is where the OTP challenge lives, so the attacker avoids it entirely and approaches a sensitive page with whatever session state the browser still holds. Why would this work? Because the site has to decide, for every request, whether to show the page, redirect to login, or show the re-authentication prompt. By going straight to a sensitive page, you force that decision to happen on the re-authentication path rather than the login path.
Step 3: Trigger the re-authentication prompt
The backend recognises the expired or partial session token and halts full access. Rather than redirecting to the full login page, it redirects to a prompt reading:
Please enter your password to continue to Settings.
This is the text the user sees. There is nothing to decode: it is a sentence asking for the password. The significance is what it does not ask for. At this stage the application has decided that the visitor is a known user who needs to confirm identity, not an unauthenticated stranger who needs to log in from scratch. That decision is the fork in the road. From here, the site is on the short path.
Step 4: Supply the primary password
The user enters the primary account password. The server validates it, grants access to /settings, and at the same time updates the session state to Fully Authenticated. No OTP is requested at any point in this exchange.
Why is this the bug? Because two things happened when only one was intended. The first, unlocking settings, is the feature working as designed. The second, marking the whole session as fully logged in, is the feature doing far more than it was meant to. The server treated a password check as proof of everything, including the second factor it never checked.
Step 5: Use the elevated session across the application
From that moment the user can browse the entire application, including Dashboard, Profile, Billing and internal actions, without ever being prompted for a 2FA OTP token. The narrow confirmation for one page has become a global login state.
This is the payoff for an attacker. They do not need to stay on the settings page. The session note now says "fully logged in", so every other page trusts it. The second factor has effectively been skipped for the whole account.
Why it went wrong
The report describes the issue as inadequate state verification during privilege elevation, a re-authentication flaw. In everyday words: the site did not check the full set of conditions before raising your trust level. Two design decisions combine to produce it.
- Partial session retention. The application does not completely invalidate and destroy long-lived session cookies on the server side after expiration. A stale token remains in a semi-active state that still accepts the re-authentication shortcut. In the hotel comparison, the old key card is not cancelled; it just stops opening the room, while the front desk still treats it as valid for a password-only confirmation.
- Flawed state transition. When the user supplies the correct password at the
/settingsprompt, the backend logic treats identity verification as complete. It refreshes the session flag toAUTHENTICATED=TRUEacross the entire application context, without checking whether the account has 2FA enabled (IS_2FA_VERIFIED).
Those two names in backticks are the report's shorthand for the server's internal notes. AUTHENTICATED=TRUE means "this session is fully logged in". IS_2FA_VERIFIED means "this account has passed its second factor". The bug is that the first was set without consulting the second.
In short, the application treats a quick password check as an absolute substitute for the entire multi-factor authentication pipeline. The existing defence, the 2FA requirement, is only enforced on the login path. The re-authentication path was never wired into the same check, so the defence simply does not apply to it. This is a classic logic flaw: no code was broken, a rule was simply missing from one route.
What an attacker could do with it
A user who holds the primary password of a 2FA-protected account, but not the second factor, can obtain a fully authenticated session. Two conditions must hold: the account has 2FA enabled, and a partial or expired session token for that account is still present and accepted by the server, for example after the legitimate user logged out or left the session inactive for a long time.
Once the password is entered at the re-authentication prompt, the attacker reaches the whole application, including Dashboard, Profile, Billing and internal actions, without an OTP. The practical effect is that the second factor is never requested in this scenario.
That is the real-world meaning of the bug. 2FA exists so that a leaked or guessed password is not enough. Here, for accounts in this state, it was enough. The report does not give a severity rating, a CVSS score or a bounty amount, and the finding was a duplicate.
How to fix it
The report lists three remediations.
- Enforce unified auth checks. Any action or prompt that elevates a session from expired or unverified to fully authenticated must evaluate all required authentication factors, password plus 2FA. In plain words: if the result is a full login, the check must be the full login check, no matter which door you came through.
- Strict session invalidation. Invalidate and clear stale session tokens completely on timeout, rather than leaving them in a semi-active state that accepts re-authentication shortcuts. In plain words: when the hotel key card expires, cancel it at the front desk too.
- Contextual permissions. Re-authentication prompts for sensitive actions should grant narrow, localised permissions rather than elevating the global session state. In plain words: a password check to open settings should unlock settings, not the whole account.
Other places to look for the same pattern
These are not steps that were performed; they are places where the same mistake could appear.
- Other sensitive endpoints behind a re-auth prompt. Try direct navigation to endpoints such as billing, email change or API key management while holding an expired session. A positive result is a password-only prompt that, once satisfied, leaves the session able to reach unrelated areas of the application.
- Password change and email change flows. These often ask for the current password as confirmation. Check whether completing them also flips the session to fully authenticated. A positive result is that a subsequent visit to a 2FA-gated page no longer asks for an OTP.
- Remember-me and long-lived cookies. Log out, then replay the old session cookie against a sensitive endpoint. A positive result is that the server accepts the stale token and offers the re-authentication prompt instead of rejecting the session.
- Step-up prompts on API routes. Repeat the same direct navigation against JSON or API endpoints rather than HTML pages. A positive result is a response that returns data or a new session token after only the password, with no OTP challenge.
- Session flag inspection. Compare the session state before and after the re-authentication prompt, for example by observing which pages become reachable. A positive result is that pages which previously redirected to login or to the OTP step now load directly.
Even when a finding turns out to be a duplicate, exploring how state machines fail behind the scenes is a good exercise in logic testing. The lesson for anyone starting out is that you do not always need clever payloads. Sometimes simply asking a website to do things in an unusual order is enough.
Glossary
- 2FA (two-factor authentication): a login method that requires two different proofs of identity, typically a password plus a one-time code.
- OTP (one-time password): a short code valid for a single login or action, often generated by an app or sent by message.
- Session: the server's memory of your current visit and how logged in you are.
- Session cookie / session token: the small piece of data your browser stores and sends back so the server can recognise your session.
- Session state: the server's note about your login progress, such as not logged in, partly verified, or fully authenticated.
- Endpoint: a specific address on a website or API that performs one job.
- URL: a web address, such as
https://target.com/settings. - API: a way for software to talk to a server and get data or trigger actions, usually without a normal web page.
- Re-authentication: a prompt asking you to confirm your identity again, usually with your password, before a sensitive action.
- Privilege elevation: raising how much an account is trusted or allowed to do.
- Logic flaw: a security bug where everything works as designed but the design allows something it should not.
- State transition: a change from one status to another, for example from partly verified to fully authenticated.
AUTHENTICATED=TRUE: the report's shorthand for the server marking a session as fully logged in.IS_2FA_VERIFIED: the report's shorthand for the server's note that an account has passed its second factor.- Duplicate: a bug report closed because the same issue was already reported.
- CVSS: a standard scoring system for rating the severity of a security issue; the report gives no score.
- Bounty: a payment some bug bounty programs make for valid reports; the report gives no amount.