Skip to content
CSRF Write-up Beginner

CSRF Leads to Delete User Account

The delete account function lacked a valid CSRF token check, and the token from the password reset page was accepted. An attacker could craft a request that deletes a victim's account if the victim visits a malicious page, but only if the Referer header contains the target domain.

Omarbakrey Follow

Published on medium.com

Hey there, this is my first write-up so don’t expect it to be “professional” or something like this :”D

Omarbakrey, 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

What the attacker needed

Victim is logged in; victim visits attacker-controlled page; Referer header contains target domain

How it was found

  1. Find the delete account button and intercept the request in Burp.
  2. Observe that a CSRF token is required and that removing or changing it causes a 403 error.
  3. Request a new password and obtain a CSRF token from the password reset page.
  4. Replace the delete request's CSRF token with the token from the password reset page.
  5. Send the modified request and observe it succeeds (200 OK).
  6. Test Origin and Referer headers: Origin from attack.com gives 200 OK, Referer from attack.com gives 403 Forbidden, but Referer containing the target domain gives 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.

CSRF (Cross-Site Request Forgery) is when a malicious website makes a logged-in user's browser send a request to another site without the user's knowledge. Here, the delete account button did not properly check a secret token, so an attacker could trick a user into deleting their own account. The attack only worked if the browser's Referer header included the target's domain, which limits how it can be exploited.

What is CSRF?

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

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.