Skip to content
CSRF Write-up Beginner

How I Exploited a Hidden CSRF Vulnerability — And How You Can Prevent It

The email-change form on the account settings page accepted POST requests without any anti-CSRF token, so a page on another site could submit it using the victim's session cookie. An attacker could silently change a victim's registered email address, receive password reset links there and potentially take over the account.

Mr Horbio Follow

Published on infosecwriteups.com

It was a quiet Sunday evening, one of those days when you tell yourself, “Just one quick recon session before bed.” But as every bug hunter knows, quick often turns into hours when curiosity strikes.

Mr Horbio, on infosecwriteups.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

The email-change endpoint accepted state-changing POST requests without a CSRF token or any other check that the request originated from the application's own pages.

Impact

An attacker could change a victim's email without their knowledge, receive password reset links at their own address and potentially take over the account; the text does not say whether the new address had to be verified first.

What the attacker needed

A free account; victim is logged in; victim visits attacker's page

The fix

The issue was fixed by adding CSRF tokens to all sensitive POST requests, adding extra confirmation steps for email changes and reviewing other endpoints.

How it was found

  1. Log in to a test account and open the account settings email page.
  2. Inspect the email-change form and the submitted request for a CSRF token.
  3. Build a page that auto-submits the email-change form to the target.
  4. Host the page on a controlled domain and visit it while logged in.
  5. Check the account settings and see the email address has 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 log in to a site, your browser keeps a cookie that proves who you are, and it sends that cookie with every request to the site. Cross-site request forgery (CSRF) is when another website makes your browser send a request to the site you are logged into, so the site thinks you asked for it. Here the email-change form had nothing that proved the request came from the site's own page, so any other page could submit it for you.

What is CSRF?

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

More by Mr Horbio

View all

2 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.