Interesting OTP Validation Logic Flaw: Registering Any Victim’s Email Without Inbox Access …
The OTP verification step did not bind the submitted code to the email address, relying only on the session. An attacker could register an account with a victim's email without access to their inbox by reusing a previously verified session and spoofing the redirect response.
Published on medium.com
Hello Community👋, My name is Divyank Sitapara , a security researcher & Bug Bounty Hunter. I hope you all are doing well.
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 OTP was tied only to the session cookie and not to the specific email address, and the frontend trusted redirect headers without server-side revalidation.
Impact
An attacker could create and control an account using any victim's email address without inbox access, and enable 2FA to lock the victim out of future registration or password reset.
What the attacker needed
Attacker has a valid email to start; victim's email address known; ability to intercept and modify responses
The fix
The application should bind the OTP to the specific email address and revalidate the OTP/email match on the server before allowing account creation.
How it was found
- Register with your own email and receive a valid OTP.
- Enter the OTP, capture the verification request and response, then drop the response.
- Refresh the browser and enter the victim's email address.
- Submit a random OTP and intercept the response.
- Replace the redirect headers and script in the invalid response with those from the valid response.
- Forward the modified response, then set a username and password to create the account.
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 site sends a one-time code (OTP) to your email to prove you own it. Here, the site checked the code against your browser session rather than the email address, so an attacker could trick it into accepting a wrong code for someone else's email. This let them create an account using the victim's email address without ever seeing 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.