How I Bypassed 2FA while Resetting Password
The password reset endpoint had two variants: one that enforced 2FA and one that did not. By changing the request path from the 2FA-enforcing endpoint to the non-enforcing one, an attacker could reset the password and reach the dashboard without providing a second factor.
Published on infosecwriteups.com
After checking all possible methods, I came to reset password functionality and I send a password reset link and opened it in my browser.
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 application exposed two password-reset endpoints with different security checks, and the one without the 2FA check was still reachable.
Impact
An attacker who can obtain a password reset link could reset the password and reach the dashboard without providing the second factor, bypassing 2FA.
What the attacker needed
A password reset link for the victim; ability to intercept and modify requests
How it was found
- Request a password reset link and open it.
- Enter a new password and capture the request in Burp.
- Note that the request goes to /reset2fa and redirects to the 2FA page.
- Disable 2FA on the account and repeat the reset to see the request goes to /reset and redirects to the dashboard.
- Re-enable 2FA, request a new reset, and capture the /reset2fa request.
- Change the path from /reset2fa to /reset and forward; the response redirects to the dashboard.
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, like a code from your phone, asked for after your password. Here the site had two reset addresses: one asked for the 2FA code, the other did not. The attacker simply used the address that skipped the code, so knowing the reset link was enough to take over 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.