Zero-Click Account Takeover: The Power of JavaScript Analysis
The password reset page trusted a username stored in browser localStorage when no reset token was supplied, so an attacker who set that value to a victim's email could change the victim's password without any token. The attacker needed to know the victim's email address, and the program rated the issue Medium due to this complexity.
medium.com
Published on medium.com
Since this is my first article here, let me quickly introduce myself: I’m Ali Saadi, a full-stack web developer, web security researcher, and a law student from the land of the first written letters.
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 password reset logic used a client-controlled localStorage value as the account identifier when no reset token was present, instead of requiring a valid server-issued token.
Impact
An attacker who knows a victim's email address could change that user's password without any interaction from the victim, leading to account takeover; the program rated it Medium because knowing the email was considered a high complexity factor.
What the attacker needed
Know the victim's email address; attacker can edit their own browser localStorage; victim has an account on the application
The fix
The vulnerability was fixed according to the author, though the exact fix is not described; it should require a valid server-issued reset token and never trust client-side localStorage for identifying the account.
How it was found
- Open the browser's developer tools and add a localStorage entry named loggedInApplicantUser with a JSON value containing the victim's email as userName.
- Navigate to the password reset page with an empty uuid parameter.
- Enter a new password and submit the form.
- Observe a 200 response confirming the password was updated for the victim's email.
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 reset a password, the site should check a secret token from your email to prove it's you. Here, if that token was missing, the site instead trusted a username saved in your browser's local storage, which anyone can edit. So an attacker could put a victim's email there and set a new password for that 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.