The Password Alchemist: How a Simple Parameter Swap Led to Full Account Takeover
The password reset endpoint accepted a client-supplied user identifier and reset the password of whichever account that identifier named, without checking that the requester owned it. An attacker could change the identifier to a victim's username and set a new password, gaining full access to the victim's account.
osintteam.blog
Published on osintteam.blog
Hey folks, recently I found a vulnerability in a web application during testing of a private Vulnerability Disclosure Program. It was a simple account takeover via password reset functionality, due to poor input validation.
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
The reset endpoint trusted a client-supplied user identifier and did not bind the request to the authenticated reset token or verify authorisation.
Impact
An attacker could take over any account whose username they know, without access to the victim's email or reset token.
What the attacker needed
A valid reset link for the attacker's own account; knowledge of the victim's username; ability to intercept and modify requests
The fix
The reset endpoint should derive the target user from the validated reset token and enforce server-side authorisation, rather than trusting a client-supplied identifier.
How it was found
- Request a password reset for the attacker's own account and receive the reset link.
- Open the reset link, enter a new password, and intercept the submission.
- Change the userId field from the attacker's name to the victim's name and forward the request.
- Log in as the victim with the new password to confirm full account access.
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 a password, a site usually sends a special link so only you can set a new one. Here, the page that saves the new password also accepted a hidden field saying which account to change, and the server believed it without checking. By editing that field to someone else's name, the tester could set that person's password and log in as them.
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.