Exposing OTP Bypass Vulnerabilities: Step-by-Step Bug Bounty Case Study
The login flow relied on the client to decide whether OTP verification had succeeded, so an attacker could change the server's error response to a success response and reuse a captured access token to log in without a valid OTP. This let the attacker access the account and place orders.
In the ever-evolving landscape of cybersecurity, the protection of user data is paramount. One common security measure implemented by many platforms is the use of One-Time Passwords (OTPs) for user verification.
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 gain access to a user's account without a valid OTP, which could lead to data breaches and unauthorised transactions.
What the attacker needed
A mobile number tied to an account; a proxy tool to intercept traffic; a previously captured successful access token
The fix
The OTP result should be validated on the server and the session should only be issued after a correct OTP, rather than trusting a client-side response code or a previously captured token.
How it was found
- Visit the website and open the login screen.
- Enter a mobile number and continue to the OTP verification step.
- Intercept the OTP request with a proxy tool.
- Enter a random OTP and forward the request until the OTP and mobile number details appear.
- Switch the proxy to intercept the response to this request.
- Change the error response code to a success code, reuse the captured access token, and submit; then confirm by adding a product and reaching the place order page with the mobile number pre-filled.
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 (OTP) is a short code sent to your phone to prove it is you. Here the website trusted the browser's copy of the server's reply, so the tester edited that reply from an error into a success and reused a token from an earlier successful login. The site then treated the session as verified even though the code was wrong.
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.