Skip to content
Account takeover Write-up Beginner

2FA Bypass By Response Manipulation

The two-factor authentication check was performed on the client side, so the server did not validate the OTP itself. An attacker who already had a valid password could replace the error response with a previously captured success response and log in without the correct one-time code.

FuzzyyDuck Follow

Published on medium.com

Hey, fellow hackers! In this blog post I’ll share how I found a simple bypass for two-factor authentication (2FA) using simple trick.

Fuzzyy Duck, 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 application relied on client-side validation of the OTP and did not enforce the check on the server, so the login outcome could be changed by editing the response.

Impact

An attacker who already knows a user's password could bypass 2FA and take over the account, although the report does not show this against a real victim.

What the attacker needed

Valid username and password; ability to intercept and edit responses; 2FA enabled on the account

The fix

The OTP should be validated on the server, and the server should decide the login outcome rather than trusting a response the client can edit.

How it was found

  1. Create an account, enable two-factor authentication, then log out.
  2. Log in again and reach the step where the system asks for the OTP.
  3. Enter the correct OTP, intercept the request, and save the successful response.
  4. Log out and start the login flow again.
  5. Enter a wrong OTP and intercept the request and response.
  6. Replace the error response with the saved successful response and forward it.

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) asks for a second proof, such as a one-time code, after your password. Here the website's browser code decided whether the code was correct, and the server simply trusted that decision. By swapping the server's 'wrong code' reply for a saved 'correct code' reply, the tester got in without knowing the real 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.