Skip to content
Account takeover Write-up Intermediate

this is how I Bypassed the 2FA page in a big site…

The site's two-factor authentication page decided whether to let a user in based on the response body from the OTP verification API, and the response contained a single-use login token. An attacker could replace the response to a wrong OTP with a valid response containing a fresh token from their own account, bypassing the second factor.

hannorayousef Follow

Published on medium.com

Hello everyone I am Yousef, I just started my journey of learning BugBounty, when I was studying for response manipulation technique to bypass authentication parameters like CAPTCHA and 2FA pages, I like to practice on real sites, so I found that the site I was practicing on (let's say it’s mysite[.]com), receiving a…

Bar_0_0_n, 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

Impact

An attacker who knows a victim's password could bypass the second factor and log in, though the report notes the bug was later marked as a duplicate.

What the attacker needed

Victim's username and password; attacker account with 2FA enabled; ability to intercept and modify responses

How it was found

  1. Create an attacker account and enable 2FA on it.
  2. Log in with the attacker account, enter the received OTP, and intercept the response.
  3. Copy the token from the CallBackPage field and drop the response so the server does not destroy it.
  4. Log in to the victim's account, enter a random OTP, and intercept the response.
  5. Replace the response body with the valid response containing the fresh token.

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, usually a one-time code sent to your email or phone, after your password. Here the website trusted a message from its own server that said 'code correct' and included a login token, instead of checking the code itself. By swapping that message for a real one from their own account, an attacker could skip the code check entirely.

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.