How I Found an Account Takeover via OTP Bypass Vulnerability (Bug
The login API response for the OTP-based login flow included the one-time password itself, so the code meant to be sent privately to the user's phone was visible in the intercepted traffic. An attacker who could observe that response could read the OTP and use it to log into the account.
Published on medium.com
One-Time Password (OTP) is used to add an extra layer of security in web applications to strengthen login authentication and prevent unauthorized access. 🔐
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 returned the generated OTP in the login API response instead of only sending it to the registered mobile number.
Impact
Because the OTP was exposed in the response, an attacker able to see it could complete the OTP login and take over the account; the author states it could lead to account takeover.
What the attacker needed
Access to the login API response; a registered mobile number on the account
The fix
The OTP should not be returned in the API response and should only be delivered to the registered mobile number; the author reports the issue was later fixed.
How it was found
- Open the shopping platform's login page and choose the option to log in with an OTP sent to the mobile number.
- Turn on interception in a proxy tool and capture the login API request triggered by that option.
- Inspect the captured response and note that the OTP value is included in it.
- Enter that same OTP on the verification screen and observe that the session is authenticated.
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.
A one-time password is a short code sent to your phone to prove it is really you logging in. Here the website put that secret code inside the data it sent back to the browser, so anyone who could see that data could read the code and use it to sign in as the user.
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.