Skip to content
CSRF Write-up Intermediate

Bruteforce user IDs via CSRF to delete all the users with CSRF attack

The delete-user endpoint lacked CSRF protection and accepted a numeric user ID, so an attacker could make an admin's browser send deletion requests. Because the IDs were five-digit numbers, the attacker could brute-force them and delete all users.

Armaan Pathan Follow

Published on medium.com

While testing an application, there was a module “Delete User” in which an admin can delete any user.

Armaan Pathan, 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

The delete-user request had no CSRF token or other protection, and user IDs were predictable sequential numbers.

Impact

An attacker could delete all existing users from the application by getting an admin to visit a malicious page.

What the attacker needed

Admin visits attacker's page; attacker knows delete endpoint; user IDs are numeric

How it was found

  1. Identify the delete-user request and note it has no CSRF token.
  2. Note the request contains a numeric user ID.
  3. Try to load the app in a frame to brute-force IDs, but find X-Frame-Options blocks it.
  4. Try XMLHttpRequest, but find Origin validation blocks it.
  5. Send requests via an iframe target, which works even though the response cannot be read.
  6. Send the CSRF script to the admin, which brute-forces IDs and deletes all users.

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 meaning to. Here the delete-user action had no secret token to prove the request was intended, so a page could trigger deletions. The user IDs were simple numbers, so the attacker could try many of them.

What is CSRF?

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

More by Armaan Pathan

View all

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