OTPs For Everyone: The Simplest $OTP Leak$ You’ll Ever Find
The application sent the same OTP code to multiple email addresses when the Mobileusername header was duplicated. An attacker could register an account using a victim's email address by placing the victim's email first and their own second, then completing verification with the OTP sent to both.
medium.com
Published on medium.com
Some time ago, I came across a Program on Hackerone which had a wildcard () subdomain like .target.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 did not reject duplicate Mobileusername headers and instead processed all values, sending a single OTP to every email listed.
Impact
An attacker could create and verify an account using a victim's email address, because the server ties the first Mobileusername header to the account being created.
What the attacker needed
A free account on the target; ability to intercept HTTP requests; attacker controls a second email address
The fix
The server should reject requests that contain more than one Mobileusername header, or only process the first value securely.
How it was found
- Sign up on the target application and reach the email verification stage.
- Capture the GET request to the OTP endpoint in Burp Suite.
- Duplicate the Mobileusername header, setting one value to the attacker's email and the other to a second email.
- Send the request and observe that a verificationID is returned.
- Check both email inboxes and confirm the same OTP code arrived in each.
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 app sends a one-time code (OTP) to your email to prove it is yours. Here, the app accepted two email addresses in the same request and sent the same code to both. That let someone else receive the code meant for the victim's email and finish creating an account under the victim's address.
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.