How I Hacked Any User Account in 5Minutes: A Critical Account Tak
The password reset endpoint accepted a client-supplied user_id parameter, allowing an attacker to change any user's password by modifying that value. An attacker could take over any account by requesting an OTP for their own email, validating it, and then changing the user_id to the victim's ID.
Published on medium.com
Hello everyone! Today I want to share one of the most shocking security bugs I have ever found.
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 server trusted a client-provided user_id parameter to determine which account's password to reset, instead of deriving the user from the validated reset token.
Impact
An attacker could take over any user account, including administrators, and gain full control to read messages, change settings, and lock out the real owner.
What the attacker needed
A free account on the target site; ability to intercept HTTP requests; victim's user ID (often guessable)
The fix
The password reset request should not include a user_id parameter; the server should identify the user from the secure reset token and validate that the token is tied to that user.
How it was found
- Request a password reset OTP for the attacker's own email address.
- Validate the received OTP to reach the password reset page.
- Enter a new password and intercept the reset request with Burp Suite.
- Modify the user_id parameter in the request to the victim's user ID.
- Forward the modified request to change the victim's password.
- Log in as the victim using the new password.
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 website should only change the password for the account that requested the reset. Here, the website let the user say which account to change by including a number in the request. An attacker could simply change that number to someone else's and take over their 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.