How I Found a Critical Information Leak in an Authentication Flow
The login endpoint returned the user's email address, full name and internal user ID in the response to the initial OTP request, before the OTP was verified. An attacker who knew a registered mobile number could therefore learn the linked email address and account identifier without logging in.
Published on medium.com
Information leakage vulnerabilities occur when an application unintentionally exposes sensitive user data without proper authentication or authorization. This often happens due to poor validation or improper handling of request and responses in authentication flows as you can see below.
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 login endpoint built its response from the full user record looked up by phone number, rather than returning only the minimum needed to confirm that an OTP was sent.
Impact
An attacker who knows a registered mobile number could obtain the linked email address, full name and internal user ID without authenticating, which could aid phishing or further account attacks.
What the attacker needed
Knowledge of a registered mobile number; ability to intercept HTTP traffic
The fix
The login response should be limited to a confirmation that the OTP was sent, with user details returned only after successful verification.
How it was found
- Enable the interceptor in Burp Suite and capture the login request.
- Submit a registered mobile number to the OTP-based login endpoint.
- Inspect the response returned before OTP verification.
- Observe that the email address, full name and user ID are included.
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 log in with a phone number, the app sends a one-time code (OTP) to prove the number is yours. This app also sent back the account's email address and internal ID in that same first response, before the code was checked. Anyone who knew a phone number could therefore find out which email address and account it belonged to.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.