How I Bypassed Otp Verification Through Response Tampering
The login flow used OTP verification, but the backend did not bind the OTP success response to the user or session. An attacker could reuse a previously valid success response for a different account and log in without knowing that account's OTP.
Published on infosecwriteups.com
While testing a website, I discovered a critical security flaw in its login flow. The site used a standard OTP-based authentication system, but due to improper backend validation, I was able to bypass OTP verification using response tampering.
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 backend did not bind the OTP verification result to the specific user and session, so a successful response could be reused for another account.
Impact
An attacker could take over any user's account without knowing the correct OTP, exposing personal information and session details.
What the attacker needed
A valid account to obtain a successful OTP response; ability to intercept and modify HTTP responses; target account email address
The fix
OTPs should be bound to the correct user and session, and OTP verification responses should not be reusable or modifiable across sessions or users.
How it was found
- Log in with your own email and correct OTP while intercepting traffic.
- Save the successful OTP verification response.
- Start a login attempt with a different email and enter a random OTP.
- Intercept the failed response and replace it with the saved successful response.
- Forward the tampered response and observe login as the second user.
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 prove you own an account. Here the server checked the code but then trusted a saved 'success' reply from an earlier login, so a tester could swap in that old reply for a different account and get in without 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.