OTP Bypassing with Response Manipulation
The login/signup endpoint returned a 403 response for an incorrect OTP, and the author used an intercepting proxy to change that response to 200 OK. The server then treated the session as authenticated without a valid OTP.
Published on medium.com
If you are unfamiliar with response manipulation then I will explain it to you. When you log in or sign up on any website then it asks you for an OTP. when you enter the correct OTP then you will see 200 OK in the response and if you have entered the wrong OTP.
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 client-side application trusted the HTTP status code returned by the OTP verification endpoint to decide authentication state, instead of the server enforcing a valid OTP before issuing a session.
Impact
An attacker could authenticate as any user who has just signed up, without knowing the OTP, by rewriting the server response in their own proxy.
What the attacker needed
A phone number to start signup; an intercepting proxy; the attacker controls their own browser
How it was found
- Sign up on the target site and receive a request to enter a six-digit OTP.
- Submit a random OTP and capture the loginOrSignup request.
- Change the API version in the path from v2_1 to v1.
- Enable interception of the response to that request in the proxy.
- Forward the request and edit the 403 response to 200 OK, removing the forbidden body.
- Observe that the application logs you in without the correct OTP.
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 server checks your one-time code and replies with a status code such as 403 (denied) or 200 (ok). Here the browser-side app trusted that status code to decide whether you were logged in, so the author used a proxy tool to rewrite the reply from 403 to 200. The server-side session was then treated as valid 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.