Skip to content
CSRF Disclosed report Intermediate

CSRF Token Bypass in Account Deletion

The CSRF token used for account deletion was not tied to the user session, so a token from one account could be used to delete another account. An attacker could craft a self-submitting form to delete a logged-in victim's account.

7h0r4pp4n Follow

Originally disclosed on HackerOne

  • Triaged in 16 days
  • Fixed in 3 months
  • Disclosed after 5 months

The authentication token authenticity_token used in the POST request for deleting an account can be bypassed, by replacing the same with a token generated for deleting another account. This way, a self submitting form can be used to delete another user's account as long as he/she's logged in.

Steps to Reproduce:

  1. Create an account and copy the POST request for deleting it.
POST /users HTTP/1.1
Host: gitlab.com
Referer: https://gitlab.com/profile/account
Cookie: _gitlab_session=1staccount_cookie;
Content-Type: application/x-www-form-urlencoded

_method=delete&authenticity_token=auth_1staccount
  1. Create another account and send the above request after replacing the _gitlab_session cookie with that of the new one. The authenticity_token remains the same as that of the first account.
  2. Send the request and the new account gets deleted.

I have not explored all possible scenarios like different IP addresses or something. But the above situation, where I used accounts created using emails from a temporary email address generator, was reproduced multiple times.

The original report as published on HackerOne, by 7h0r4pp4n. 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

Root cause

Likely the server validated the CSRF token's existence but did not bind it to the user session, so any valid token was accepted for any account.

What the attacker needed

Victim is logged in; victim submits a crafted form; attacker has a valid CSRF token

How it was found

  1. Create an account and capture the POST request used to delete it.
  2. Create a second account and replace the session cookie in the captured request with the second account's cookie, keeping the first account's token.
  3. Send the request and observe that the second 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.

Websites use a secret token to make sure a form submission really came from their own site and not from an attacker's page. Here, the token was not checked against the specific user, so a token from one account worked for another. That let an attacker 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 7h0r4pp4n

View all

2 more disclosed reports, best first.

More from GitLab

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.