A Story of Zero-click complete Account Takeover
An endpoint that checks whether a user exists returned a username hash for any email, and a separate password-change endpoint accepted that hash without further authorisation, letting an attacker set a new password for any user. The attacker could therefore take over any account without the victim doing anything.
Published on medium.com
This is my first blog, please ignore any mistakes and enjoy the write-up, hope this helps you in learning something new.
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-change endpoint trusted the username hash as proof of identity without verifying the caller's session or authorisation.
Impact
An attacker could take over any user account without any action from the victim.
What the attacker needed
Knowledge of victim's email; no victim interaction
How it was found
- Visit the target application.
- Send a request to the checkExistUser endpoint with a victim's email to confirm the user exists.
- Receive the username hash in the response.
- Send a request to the setPasswordCognitoAdmin endpoint using the username hash and a new password.
- Log in with the victim's email and the new password to confirm the takeover.
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.
A website had a form that told you if an email address was registered, and it also gave back a special code for that user. Another part of the site, used to reset passwords, trusted that code without checking who was asking. So anyone could ask for the code and then use it to set a new password on 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.