My first Account-take-over
The email change function did not properly validate the referrer or CSRF token, allowing an attacker to change a victim's email address and take over the account. The author confirmed the referrer could be set to an external site and the token check was bypassable.
Published on medium.com
Hi, welcome back to another blog. In this blog, we’re going to know how I found my (Account — take — over)) in the external program.
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 email change endpoint lacked proper CSRF protection: it accepted requests with an arbitrary Referer header and did not enforce a valid anti-CSRF token.
Impact
An attacker could change a victim's email address, leading to account takeover.
What the attacker needed
Victim is logged in; victim visits attacker's page
How it was found
- Find the email change function on the website.
- Check if the Referer header can be set to an external domain.
- Check if the CSRF token can be bypassed.
- Create an HTML page that sends the email change request.
- Confirm the request succeeds (200 OK).
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.
A website lets you change your email address, which is often used to log in. The site did not check that the request came from its own pages or that a secret code (CSRF token) was present. An attacker could trick a logged-in user into submitting a request that changes their email to the attacker's, giving the attacker control of the account.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.