Skip to content
Account takeover Write-up Beginner

A Simple 2FA Bypass

The two-factor authentication check could be bypassed by manipulating the server's response to a wrong OTP submission. An attacker with valid credentials could change the response status and body to appear successful, gaining access without a valid OTP.

infosecwriteups.com

Published on infosecwriteups.com

Two-Factor Authentication (2FA) serves as a robust shield against unauthorized access. However, during a recent engagement in a RVDP, I found a critical vulnerability that allows an attacker to bypass 2FA using response manipulation.

hackerdevil, on infosecwriteups.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 with valid credentials could bypass 2FA and access the account without a valid OTP.

What the attacker needed

Valid login credentials; ability to intercept and modify responses

How it was found

  1. Log in as a normal user and enable 2FA for the account.
  2. Log out and log in again with the login credentials.
  3. Enter a wrong OTP and capture the response to that request.
  4. Change the response status code to 200 OK and replace the body with the content of a valid OTP response.
  5. Observe that the 2FA is bypassed and access is granted.

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) adds a second step after your password, usually a code from your phone. This report shows that the server's reply to a wrong code could be altered by the attacker to look like a correct one, so the app let them in without the real code. It is like changing a 'denied' stamp to 'approved' on a form.

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.