Authentication Bypass due to Sensitive Data Exposure in Local Storage
The application stored other users' account details (username, accountID, hostname, port) in local storage even for unauthenticated visitors. An attacker could use that leaked data to modify the response to an incorrect OTP login request and log in as those users.
Published on medium.com
I’m Kritika. This is my very first blog post on Web Application Security.
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 server trusted client-side response data and leaked other users' identifiers in local storage, allowing response manipulation to bypass OTP verification.
Impact
An attacker could log into accounts of users whose data happened to be disclosed at that moment, but not arbitrary accounts, so severity was reduced to P2.
What the attacker needed
A phone number to create an account; ability to intercept and modify responses; victim's data present in local storage
How it was found
- Create an account with a phone number and capture the OTP verification request in Burp.
- Intercept the response to the correct OTP request and note its structure.
- Create another account with an arbitrary phone number, enter a random OTP, and intercept the response.
- Open the application unauthenticated in a private window and read other users' details from local storage.
- Modify the incorrect OTP response body using the leaked details (e.g. set loginResult to LOGGED_IN) and forward it.
- Observe that the attacker is logged into 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 log in with a phone number, the app sends a code and checks it. Here, the app also put other people's account details into the browser's local storage, which any visitor could read. By changing the server's reply to a wrong code, the attacker could pretend the code was correct and enter someone else's account.
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.