Authentication Token Reuse — A Silent 2FA Killer
The application issues an authentication token before the second factor (OTP) is verified, and the server accepts that token to access protected endpoints. An attacker who has valid credentials and a previously captured pre-OTP token can skip the OTP step and reach the account.
Published on medium.com
Two-Factor Authentication (2FA) is widely used to protect users from unauthorized access, even if credentials are compromised. But what happens when 2FA isn’t enforced properly after login?
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 treats a token issued before OTP verification as fully authenticated, instead of issuing access tokens only after the second factor succeeds.
Impact
An attacker with valid credentials and a captured pre-OTP token could bypass 2FA and access the account and its sensitive data.
What the attacker needed
Valid username and password; a previously captured pre-OTP token; ability to send requests with a custom cookie
The fix
The application should issue access tokens only after OTP verification and invalidate any pre-OTP tokens if verification is not completed.
How it was found
- Log in with correct username and password and intercept the request.
- At the OTP step, do not enter the OTP; find and copy the authentication or session cookie from the captured request.
- Send a request to an authenticated endpoint such as /profile or /dashboard using the copied cookie.
- Observe a successful response with profile or sensitive data, confirming 2FA was bypassed.
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 asks for a password and then a one-time code. Here the site hands out a login token after the password but before the code is checked, and that token already works on private pages. So someone with the password and an old token can get in without ever entering the code.
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.