Skip to content
Account takeover Write-up Intermediate

2FA Enabled Accounts Can Bypass Authentication & Access Account After Deactivation

The application's 2FA flow issued a session ID after only submitting the SMS code, without requiring the user's password or an existing session cookie. After an account was deactivated, the SMS trigger and verification endpoints still worked, so an attacker who knew the 2FA code could obtain a valid session and access the deactivated account.

Sharat Kaikolamthuruthil Follow

Published on medium.com

This write-up is about a bug which allowed an account with 2FA enabled to access the organisation after being deactivated.

Sharat Kaikolamthuruthil, 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 2FA verification endpoint issued a session based solely on a valid SMS code, and deactivation only disabled the password login without disabling the 2FA trigger and verification endpoints.

Impact

An attacker who knows the SMS code could obtain a session and access an account even after it has been deactivated, bypassing the deactivation control.

What the attacker needed

Knowledge of the victim's SMS code; ability to reach the 2FA endpoints

The fix

The 2FA trigger and verification endpoints should require a valid pre-authentication session and should be disabled when an account is deactivated.

How it was found

  1. Log in and get redirected to the 2FA trigger page, which works without any cookie.
  2. Trigger the 2FA code and submit it to receive a session ID.
  3. Deactivate the account and confirm normal login returns an error.
  4. Send a request to trigger the 2FA code for the deactivated account; an SMS code is sent.
  5. Submit the SMS code in the verification request; a valid session ID is returned.
  6. Use the session ID to access the deactivated 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) normally asks for your password and then a one-time code sent to your phone. Here the site skipped the password step and gave a logged-in session as soon as the code was entered. Worse, when an account was switched off, the code-sending and code-checking parts still worked, so someone with the code could still 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.

More by Sharat Kaikolamthuruthil

View all

6 more disclosed reports, best first.

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.