Complete User Account Takeover on an Android Application
The Android app's API returned the OTP code in the response to a password reset request, and a separate password update endpoint lacked access control, allowing an attacker to reset any user's password by knowing their mobile number.
Published on gauravnarwani.com
Hello, welcome to my second blog post. Today we will be discussing the impacts of different attacks on an android application.
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 API returned sensitive data (the OTP) in its response and failed to enforce authorization on the password update endpoint.
Impact
An attacker could take over any user's account by knowing their mobile number, without any interaction from the victim.
What the attacker needed
Knowledge of victim's mobile number; ability to intercept app traffic
The fix
The API should not return the OTP in the response, and the password update endpoint should enforce proper authorization checks.
How it was found
- Use the Forgot Password feature and enter a mobile number to request an OTP.
- Intercept the request and response in Burp Proxy; observe the OTP code in the response.
- Resend the request after the time limit to get a new OTP.
- Use the OTP from the response to reset the password for that mobile number.
- Capture the password update request and change the mobile number and password parameters.
- Send the modified request; the server accepts it and the new credentials work for the victim's account.
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 forget your password, an app sends a one-time code (OTP) to your phone to prove it's you. Here, the app's server included that secret code in its reply, so anyone watching the network could read it. Also, a password-change request didn't check who was making it, so an attacker could change anyone's password just by knowing their phone number.
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.