CSRF account takeover Explained Automated/Manual — Bug Bounty
The account settings form on the site accepted profile changes without a valid anti-CSRF token, so a page hosted elsewhere could submit a change of the victim's email and password. An attacker who got a logged-in victim to open that page could take over the account.
Published on web.archive.org
{{media:0}}
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 profile change request was accepted without validating a per-session anti-CSRF token, so a forged cross-site form submission was treated as legitimate.
Impact
An attacker could take over a victim's account by changing its email and password, provided the victim opened the crafted page while logged in.
What the attacker needed
Victim is logged in; victim opens attacker's HTML page; attacker can host a page
The fix
The issue was fixed by the vendor, presumably by enforcing a valid anti-CSRF token on the profile change request.
How it was found
- Create an attacker account and a victim account, or use one account, in two different browsers.
- Log in to both accounts and open the account settings page.
- Turn on interception in a web proxy and save the profile change request.
- Use the proxy's PoC generator to produce an HTML form and save it as a local file.
- Change the email in that HTML to the attacker's address.
- Open the file in the victim's browser, submit it, and confirm the victim's email and password were changed.
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 are logged in, your browser automatically sends your session cookie with every request to that site. A cross-site request forgery (CSRF) trick makes your browser send a change request the attacker wrote, without you meaning to. Here the site did not check a secret token, so the change went through and the attacker could set a new email and password.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.