Skip to content
CSRF Write-up Beginner

#BugBounty — How I was able to delete anyone’s account in an Online Car Rental Company

The 'Update Profile' request included a 'method' parameter that could be changed from 'put' to 'delete', allowing an attacker to delete their own account. The CSRF token was not validated on this endpoint, so an attacker could craft a CSRF attack to delete any user's account.

Avinash Jain Follow

Published on medium.com

{{media:0}}

Avinash Jain (@logicbomb_1), 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 server trusted a client-supplied 'method' parameter to determine the HTTP method and failed to validate the CSRF token on that endpoint.

Impact

An attacker could delete any user's account via CSRF, and the site had no legitimate account deactivation feature.

What the attacker needed

Victim is logged in; victim visits a malicious page

The fix

The bug was fixed by the company, as confirmed by retesting.

How it was found

  1. Capture the 'Update Profile' request.
  2. Change the value of the 'method' parameter from 'put' to 'delete'.
  3. Forward the request and observe the account is deleted.
  4. Remove the CSRF token value and forward the request to check validation.
  5. Observe a 200 OK response, indicating the token is not validated.
  6. Craft a CSRF exploit to delete another user's 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.

The website let users update their profile by sending a request that included a hidden instruction saying 'put' (meaning update). The attacker changed that instruction to 'delete', and the server obeyed, deleting the account. Normally a security token (CSRF token) prevents other sites from making such requests, but here the token was not checked, so an attacker could trick a logged-in user into deleting their own account.

What is CSRF?

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

More by Avinash Jain

View all

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