Bypass accepting terms for deleting own account
A user who had not yet accepted the terms of service could still delete their own account by submitting a form with a valid CSRF token, bypassing the normal restriction that blocks requests before acceptance. This allowed the user to perform an action that was otherwise unavailable in the UI or API.
GitLab
Originally disclosed on GitLab
- Fixed in 21 months
- Disclosed after 21 months
HackerOne report #768297 by nsauk on 2020-01-05, assigned to @jeremymatos:
Summary
User doesn't accept ToS before signing up via external provider (e.g. Github). On this step user can't turn back and delete their own account via UI, API also doesn't allow it. Using csrf-token from page sources we can bypass this limit and with own hand remove account.
Steps to reproduce
- Use two accounts (in separate browser sessions), one with ToS accepted, and second one on the step before accepting.
- On ToS-accepted account, go to https://gitlab.com/profile/account and copy HTML code of form for deleting user.
- On another account, insert this HTML code to page and replace authenticity_token with data from page source.
- Put username of deletable-by-this-hack user and press enter to submit the form and this way complete action for deleting account.
Impact
User can bypass accepting the ToS for using undocumented feature and remove their own data.
Sure, I don't think it's a real vulnerability, but it's definitely sort of privilege escalation due that normally any requests before accepting the ToS fails with 403 or redirect.
Examples
N/A
What is the current bug behavior?
User can bypass accepting the ToS and perform action that doesn't available in UI or API.
What is the expected correct behavior?
User can't bypass screen with two buttons (decline or accept), or user can delete own account in UI or API on any step of registration, including step before accepting the ToS.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
N/A
Impact
Bypass accepting terms for deleting own account. Normally any requests fails with 403 or redirect before accepting the ToS.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
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 did not enforce the terms-of-service acceptance check on the account deletion endpoint, only relying on the UI to block access.
Impact
A user could bypass the terms-of-service acceptance step to delete their own account, an action normally blocked before acceptance.
What the attacker needed
A GitLab account; account not yet accepted ToS; ability to modify page HTML
The fix
The server should enforce the terms-of-service acceptance check on all actions, including account deletion, or allow account deletion at any registration step.
How it was found
- Use two accounts: one with ToS accepted, one before accepting.
- On the ToS-accepted account, go to the account profile page and copy the HTML of the delete-user form.
- On the other account, insert that HTML into the page and replace the authenticity token with one from the page source.
- Enter the username of the account to delete and submit the form.
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.
When you sign up, you must agree to the terms of service before you can do anything. The website normally blocks all actions until you click 'accept'. This report shows that a user could still delete their account by manually sending a request with a special token, even without accepting the terms.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.