Skip to content
Account takeover Write-up Intermediate

Bypass 2FA like a Boss

The 2FA check was enforced on the main site but not on a beta subdomain, so an attacker could bypass it by changing the Host header to the beta domain and submitting an arbitrary code. This allowed login without the correct 2FA code.

Seqrity Follow

Published on medium.com

{{media:0}}

Uncle Bob, 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

What the attacker needed

Valid username and password; 2FA enabled on the account; ability to intercept and modify requests

The fix

The issue was fixed the day after the report, according to the timeline.

How it was found

  1. Create an account on the main site and enable 2FA.
  2. Intercept the login request after entering the password.
  3. Change the Host header to the beta subdomain.
  4. Enter an arbitrary code in the twofactorcode field.
  5. Forward the request and observe a successful login without the correct code.

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, to prove it is really you. Here the main website asked for that code, but a test version on a different address did not check it properly. By telling the server they were using the test address, an attacker could skip the code and get in.

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.