Otp Bypass Via Response Manipulation
The application verified OTPs only on the client side, so an attacker could change a failed OTP response to a successful one and add an arbitrary Paytm number without knowing the OTP.
Well, so for today I’m back with one of my recent findings. Which I would like to share with you guys.
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 re-validate the OTP on the backend and relied on the client-side response to determine success.
Impact
An attacker could bypass OTP verification and add an arbitrary Paytm number to the account.
What the attacker needed
A user account; ability to intercept and modify responses
How it was found
- Add a Paytm number and trigger the OTP verification.
- Enter a wrong OTP and capture the request and response using a proxy.
- Modify the response from failure to success, changing the success flag and including the phone number.
- Forward the modified response, and the number is updated successfully.
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 enter an OTP, the server sends back a message saying whether it was correct. Here, the app trusted that message in the browser instead of checking the OTP again on the server. An attacker could edit the message to say 'success' and bypass the check.
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.