Pre-Account Takeover + Account Lockout
The backend did not bind the account identifier to the OTP verification session, so an attacker could modify the email and login parameters in two requests to register and access a victim's account before the victim signed up. The attacker could then enable two-factor authentication on that account, locking the victim out.
medium.com
Published on medium.com
Hello everyone, I’m Mohamed Farghly, a Web & Network Penetration Tester and a part-time Bug Bounty Hunter
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
Impact
An attacker could take over any account that has not yet been registered and then enable two-factor authentication, preventing the real owner from logging in even after a password reset.
What the attacker needed
Attacker can intercept and modify requests; victim has not yet registered an account; both requests must be manipulated together
How it was found
- The attacker creates an account and receives a valid OTP, then submits it.
- The attacker intercepts the registration request and the login request.
- The attacker replaces the email and login values with the victim's email and forwards the requests.
- The attacker gains access to the victim's account.
- The attacker enables two-factor authentication using their own authenticator app.
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.
When you sign up, the server sends a one-time code (OTP) to prove you own the email. This report says the server did not tie that code to the specific email address, so an attacker could reuse their own valid code while changing the email to someone else's. That let the attacker create and control an account for a person who had not yet registered, and then add their own two-factor authentication (a second login step) to keep the real owner out.
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.