Skip to content
Account takeover Write-up Beginner

How a 2FA Bypass Bug Funded My EJPT Journey

The application issued the main authentication token immediately after validating the username and password, before the second factor was verified. An attacker with valid credentials could therefore skip the 2FA step and log in using that token.

medium.com

Published on medium.com

Hi, I’m Dinesh — you can call me as Professor. I’m a cybersecurity researcher who is always trying to become the best version of myself.

Dinesh Narasimhan, 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 generated and returned the full session token after password verification instead of using a temporary token until the 2FA code was confirmed.

Impact

An attacker who knows a victim's username and password could bypass the second factor and gain full access to the account.

What the attacker needed

Valid username and password; 2FA enabled on the account

The fix

The application should issue only a temporary state token after password verification and release the main session token only after the 2FA code is successfully checked.

How it was found

  1. Log in, enable 2FA, and log out.
  2. Try to log in again and capture the request and response.
  3. Observe that the response already contains the main auth_token.
  4. Enter the OTP and capture that request; note the same auth_token is returned.
  5. Use the auth_token to send authenticated requests, which succeed without the 2FA step.

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, such as a code sent to your email, that you must pass after entering your password. Here the site handed out the full login token too early, so anyone who knew the password could ignore the code step and still get in.

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.

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.