Skip to content
Account takeover Write-up Intermediate

Bypassing 2FA for Password Reset*:*By Request Manipulation *500$ Bug*

The password reset flow allowed an attacker to skip the 2FA verification step by modifying the API request to remove the '/code' endpoint and adding new password fields. An attacker who already controlled the victim's email could then set a new password and take over the account without the 2FA code.

Abhi Sharma Follow

Published on infosecwriteups.com

Recently, I found a security flaw in Exam.me(virtual name of private program) that allowed an attacker to bypass Two-Factor Authentication (2FA) during the password reset process. This write-up takes into the specifics of the issue,steps to reproduce and its potential impact.

Abhi Sharma, on infosecwriteups.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 server trusted the client-supplied request path and parameters, so removing the '/code' segment and adding password fields caused it to perform a password change without verifying the 2FA code.

Impact

An attacker who already controls the victim's email could bypass 2FA and take over the account by setting a new password.

What the attacker needed

Attacker controls victim's email; victim's account uses 2FA

How it was found

  1. Go to the password reset page.
  2. Enter the OTP received by email and click Confirm to reach the 2FA verification page.
  3. Intercept the API request sent when confirming the code verification.
  4. Remove the '/code' endpoint from the request and add password and password_confirmation parameters in JSON with the desired new password.
  5. Send the modified request.
  6. Observe that the new password is created without requiring the 2FA verification 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 check, like a code sent to your email, that you must enter after your password. Here, the website's password reset process could be tricked into skipping that second check if someone changed the request their browser sent. This meant that if an attacker already had access to the victim's email, they could set a new password and get into the account without ever needing the 2FA 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 Abhi Sharma

View all

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