Skip to content
Account takeover Write-up Intermediate

Just a Writeup about 2FA Bypass at a Private Program :)

The two-factor authentication check used a token from the request body as the user identifier instead of the email, so an attacker could supply their own valid code with the victim's token to log in as the victim. This allowed bypassing the second factor and taking over the victim's account.

medium.com

Published on medium.com

The journey at our program start with two logic duplicates :( in the same domain, But when I was testing another domain an idea came to my mind why to not just seeking bug , But try to break what meant to be secure.

Abdo Rabea (0xOverlord), 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 trusted a client-supplied token as the user identifier during 2FA verification and did not bind the submitted code to the same account, allowing a token from another account to be swapped in.

Impact

An attacker could bypass the second factor and log in to another user's account, leading to account takeover.

What the attacker needed

Two accounts with 2FA enabled; ability to intercept and modify requests; victim's token captured from their session

How it was found

  1. Create two accounts, User1 (attacker) and User2 (victim), and enable 2FA on both.
  2. Log in to User2 and capture the token from the request using Burp.
  3. Log in to User1, receive the 2FA code, enter it, and intercept the request.
  4. Edit the token from User1's to User2's and forward the request.
  5. Turn off interception and observe that you are logged in to User2's account.

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 step at login, usually a short code sent to your phone or email. The site was checking the code against a token that identified the account, but it did not make sure the token belonged to the person logging in. So an attacker could use their own code with the victim's token and get into the victim's account without ever seeing the victim's 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.

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.