Skip to content
CSRF Write-up Beginner

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.

osamamohamed21212121 Follow

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.

Osamamohamed (db3wy), 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 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

  1. Find the email change function on the website.
  2. Check if the Referer header can be set to an external domain.
  3. Check if the CSRF token can be bypassed.
  4. Create an HTML page that sends the email change request.
  5. 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.

More by osamamohamed21212121

View all

6 more disclosed reports, 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.