Skip to content
Account takeover Write-up Intermediate

2FA Bypass on private bug bounty program due to CSRF token misconfiguration

When the two-factor authentication code was removed from the login request, the application returned an error but still created a valid session. The attacker could then navigate directly to account pages and access everything without ever supplying the second factor.

Sharat Kaikolamthuruthil Follow

Published on medium.com

This is my first blog on web application security. In this I will share the first of many 2FA bypasses that I found on private bug bounty programs.

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 session was established before the 2FA check completed, and a CSRF token misconfiguration meant the failed login still left a usable authenticated session.

Impact

An attacker who already knew a victim's password could bypass the second factor entirely and access every page of the account, which matters greatly for a financial institution.

What the attacker needed

Valid username and password; 2FA enabled on the target account

How it was found

  1. Capture the login request containing the authentication token parameter in the body.
  2. Remove the authentication token from the request and forward it.
  3. Observe the error response pointing at the login URL.
  4. Change the URL to the account edit page and load it.
  5. Reach the account settings page and other pages without any 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, usually a short code, asked for after the password. Here the site checked the password, then showed an error when the code was missing, but had already logged the user in behind the scenes. So anyone with the password could skip the code and reach the account.

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.