Skip to content
Account takeover Write-up Intermediate

Logical 2FA Bypass by Reusing Trusted Device Authentication Flow

The application treats a session as fully authenticated if the user navigates to a URL reserved for trusted devices, even when logging in from an untrusted device. An attacker with valid credentials could bypass the second factor by deleting an authentication endpoint during login and then visiting that trusted-device URL.

mhmodgm54 Follow

Published on medium.com

A logic flaw in the authentication flow allows an attacker to bypass 2FA by abusing the trusted/main device mechanism. By deleting a specific authentication-related endpoint during login from a non-trusted device and then navigating to a URL normally reserved for trusted devices, the application incorrectly treats the…

Mahmoud Gamal, 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 back-end decides whether 2FA is required based on which URL the client visits rather than on a server-side session state that records whether the second factor was actually completed.

Impact

An attacker who knows a victim's password could bypass the second factor and access the account, although the report does not show this against a real victim.

What the attacker needed

Valid email and password; ability to intercept and modify login requests

How it was found

  1. Log in with email and password from a non-trusted device.
  2. Delete the authentication-related endpoint request during login.
  3. Navigate to the URL that the main device uses after login.
  4. Observe that the session is treated as authenticated without a 2FA prompt.

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 proof of identity, such as a code from an app, asked after a password. The site remembered which device was the 'main' one and skipped the code for it. The researcher found that by skipping a step in the login and opening a special page meant only for the main device, the site believed the login was complete and let them in without the 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.

More by mhmodgm54

View all

7 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.