Skip to content
Account takeover Write-up Intermediate

2FA Bypass: A Case of Insecure Implementation

The backend accepted expired and reused one-time passwords and did not tie them to a session, checking only that the auth token was valid. An attacker with a user's password could bypass the second factor by reusing an old OTP or removing the request identifier.

medium.com

Published on medium.com

Free Article Link: Click for free!

Ehtesham Ul Haq, 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 backend verified only the auth token and failed to check OTP expiry, uniqueness, or session binding.

Impact

If an attacker had a user's password, they could reuse old OTPs or bypass the session check to gain full unauthorized access, without needing to intercept real-time codes.

What the attacker needed

Valid user credentials; access to an old OTP; proxy tool to modify requests

The fix

The flaw was patched within 48 hours after being acknowledged.

How it was found

  1. Log in with valid credentials to receive the OTP.
  2. Capture the 2FA request using a proxy tool.
  3. Submit the OTP once — it works as expected.
  4. Resend the same OTP within a few minutes — it still works.
  5. Remove the request_id and resend — access is still 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 adds a second step, like a code sent to your phone, after your password. Here the server did not properly check that code: it accepted old codes and did not link the code to the login session. So someone who knew the password could get in without a fresh 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.