Skip to content
CSRF Write-up Beginner

How I hijacked your account when you opened my cat picture

The email change functionality lacked CSRF protection, allowing an attacker to change a victim's email address via a cross-site request. An attacker could then take over the account by triggering a password reset to the new email.

Matti Bijnens Follow

Published on medium.com

I set a goal for a particular program to find a way to take-over someone’s account. My goal was to be able to pick a random user (or all users) and take-over their account without any interaction.

Matti Bijnens, on medium.com

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 did not validate a CSRF token, allowing cross-site requests to perform the change.

Impact

An attacker could change a victim's email address and then take over the account, but the attack required the victim to visit a malicious page and the victim remained logged in, so it was rated medium severity.

What the attacker needed

Victim is logged in; victim visits attacker's page; attacker knows victim's email

How it was found

  1. Craft a CSRF proof-of-concept that submits a request to the email change endpoint with a new email address.
  2. Host the PoC and trick the victim into visiting it while logged in.
  3. The victim's email is changed to the attacker's email.
  4. The attacker triggers a password reset to the new email and takes over the account.

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 email on a website, the site should verify that the request came from you and not from another site. Here, it didn't, so an attacker could make your browser send a request to change your email to one they control. Then they could reset your password and take over your account.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by Matti Bijnens

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.