How I Found an OTP Authentication Bypass While Hunting for Bugs
The order tracking OTP verification relied on a client-side JSON success flag, so an attacker could intercept the server response and change it to indicate success, bypassing OTP verification. This allowed access to order tracking details without knowing the correct OTP.
medium.com
Published on medium.com
Bug hunting is often unpredictable. Sometimes you spend hours testing complex functionality and find nothing.
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
The application trusted a client-side success indicator instead of enforcing OTP verification and access control on the server.
Impact
An attacker with a valid order number and email address could bypass OTP verification and access order tracking information, including shipment status and order details.
What the attacker needed
Valid order number; associated email address; ability to intercept HTTP responses
The fix
The application should perform OTP validation entirely on the server, store verification state server-side, and enforce access controls before serving protected resources.
How it was found
- Enter a valid order number and email address to trigger an OTP.
- Submit an incorrect OTP and observe the error response.
- Intercept the OTP verification response using a proxy.
- Modify the response to set success to true and change the status code to 200.
- Forward the modified response to the browser.
- Access the order tracking functionality 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 enter an OTP, the server checks it and sends back a message saying whether it was correct. In this case, the website's front-end trusted that message to decide whether to let you in, instead of the server checking again. An attacker could change the message to say 'success' and get in without the real OTP.
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.