OTP Bypass via JSON Response Manipulation
The application relied on a client-side JSON response to decide whether an OTP was correct, so an attacker who could intercept and modify the response could set success to true and gain access without the real OTP. This allowed logging into any account linked with the integration without verifying the OTP.
medium.com
Published on medium.com
Hello, hope you’re doing well. Let me share one of my recent findings from a private program.
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 application made its access decision based on a client-side response value rather than enforcing OTP verification on the server.
Impact
Anyone who can intercept and modify requests could log into any account linked with this integration without verifying the OTP, breaking MFA and potentially leading to account takeover.
What the attacker needed
Ability to intercept and modify responses; access to the integration feature
The fix
The OTP verification should be enforced on the server side, with the client only displaying the server's decision and never trusting a client-modifiable response.
How it was found
- Access the integration section and get prompted for a 6-digit OTP sent to email.
- Enter a random 6-digit number instead of the valid OTP; it fails.
- Capture the request and inspect the JSON response.
- Edit the response to set status 200 OK, success true, and error null.
- Forward the tampered response and gain access to the section.
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 a one-time password, the app asks the server if it is correct. Here, the app trusted the answer that came back over the network without checking it was genuine. By changing that answer to say 'yes', the attacker got in without knowing the real 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.