Yet Another OTP code Leaked in the API Response
The application sends a one-time password to a user's phone during authentication, but also includes that same OTP in the API response. An attacker could read the OTP from the response and use it to sign up for or log into another person's account.
Originally disclosed on HackerOne
- Triaged in 16 hours
- Fixed in 12 days
- Disclosed after 5 months
Summary:
This is much similar to my report here(https://hackerone.com/reports/2633888) , except it affects a different domain. The application requests a phone number for authentication, then sends an OTP code to the user. But the OTP is leaked in the response which defeats the whole purpose of it's implementation.
Steps To Reproduce:
Supporting Material/References:
https://hackerone.com/reports/2633888
##Recommendation Don't return the OTP code in the API's response
Impact
It's possible to sign up with other users accounts. It's possible to log into other users accounts as well. Another thing I noticed is that, you can sign up with any 10-digit phone number since the OTP is in the response for you to use, makes creating junk accounts easily possible.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the authentication API includes the generated OTP in its JSON response instead of only sending it to the user's phone.
Impact
An attacker could sign up for or log into other users' accounts, and could also create junk accounts using any 10-digit phone number because the OTP is available in the response.
What the attacker needed
Access to the authentication API response
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 report has not been written yet. The Original tab links to the source.
When you log in with a phone number, the service sends a secret code (a one-time password, or OTP) to your phone to prove it is you. Here the service also put that secret code in the reply it sends back to the app, so anyone who can see that reply can read the code without needing your phone. That lets them finish the login as you.
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.