I discovered a new way to bypass CSRF protection to achieve Account Takeover
The registration endpoint lacked CSRF protection and accepted only email and password parameters, allowing an attacker to change a victim's password via a cross-site request. This led to account takeover.
2 days ago, I was hunting on one of my oldest target with my best friend hoping to earn some bucks because:
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 registration endpoint did not enforce CSRF tokens and accepted a minimal set of parameters, allowing password changes for existing accounts.
Impact
An attacker could change a victim's password and take over their account.
What the attacker needed
Victim is logged in; victim visits attacker's page
The fix
The registration endpoint should enforce CSRF protection and not allow password changes for existing accounts.
How it was found
- Register a new account and capture the registration request.
- Notice the registration request lacks an anti-CSRF token and uses a different password parameter name.
- Modify the registration request to include only email and pass parameters.
- Generate a CSRF proof-of-concept for this modified request and deliver it to a victim.
- Confirm the password change by logging in with 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.
CSRF (Cross-Site Request Forgery) is when a malicious website makes a logged-in user's browser send a request to another site without the user knowing. Here, the registration page did not check for a secret token, so an attacker could trick a victim into submitting a password change request. The attacker could then log in as the victim.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.