A Small Tale of Account Takeover …
The change-password function trusted a client-side response, so a user could alter the 'incorrect old password' message to 'success' and set a new password without knowing the old one. The session cookie also contained a base64-encoded user number that could be enumerated, allowing takeover of any user's or vendor's account.
Published on medium.com
In order to implement a proper user management system in view of security, systems integrate a Change Password service that allows the user to change the existing password. Even though this functionality looks straightforward and easy to implement, it is a common source of vulnerabilities.
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 relied on a client-side response to decide whether the old password was correct, and the session cookie used a predictable, enumerable user identifier.
Impact
An authenticated attacker could change any user's or vendor's password and take over their account; the cookie value did not expire after use, so it could be reused.
What the attacker needed
A valid account; ability to intercept and modify responses
The fix
The server should verify the old password itself and use an unpredictable session identifier rather than an enumerable user number.
How it was found
- Sign in and open the Change Password page.
- Enter random characters in the Old Password field and new passwords in the other fields, then capture the request.
- Capture the response and change 'Incorrect Old Password' to 'Success'.
- Forward the modified response; the application accepts it and changes the password.
- Decode the cookie to find the base64-encoded user number and enumerate it to target other accounts.
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 change your password, the website checks the old one and tells your browser whether it was right. Here the website believed the browser's answer instead of checking on the server, so someone could fake a 'yes'. Also, the login cookie included a simple number identifying the user, which could be changed to another number to act as that person.
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.