Tampering Encrypted Parameter to Account Takeover
The password reset form sent the target account's email and username as RSA-encrypted parameters, but the server trusted the client-supplied username without checking it matched the email. An attacker could encrypt the victim's email with the page's own rsaEncrypt function and swap it into the username parameter to reset the victim's password.
medium.com
Published on medium.com
Hola Infosec! Thanks for showing so much love to my previous story.
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 trusted the client-supplied encrypted username without verifying it matched the email or the reset code, so client-side encryption gave no real protection.
Impact
An attacker could change the password of any account whose email they knew, leading to account takeover.
What the attacker needed
Attacker has a valid reset code for own email; attacker knows victim's email address; victim has an account on the site
The fix
The server should verify that the username matches the email and the reset code before changing the password, rather than trusting client-side encryption.
How it was found
- Request a reset code for the attacker's own email and receive it.
- Open the forgot-password page and enter the attacker's email, the code and a new password, then intercept the request.
- In the browser console on the same page, call the rsaEncrypt function with the victim's email to get its encrypted value.
- Replace only the username parameter in the intercepted request with that encrypted victim email and submit it.
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 sends your email and username to the server. Here the site scrambled (encrypted) those values in the browser, but the server never checked that the scrambled username really belonged to the scrambled email. The attacker used the site's own scrambling function to encrypt the victim's email and put it in the username field, so the server changed the victim's password instead.
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.