My First Bug Bounty: Critical Account Deletion Vulnerability
The account deletion endpoint validated credentials from the POST body but performed the deletion on the account identified by the session cookie. An attacker could submit their own valid credentials in a forged form and lure a logged-in victim to visit it, causing the victim's account to be deleted while the attacker's account remained intact.
Published on medium.com
Let me tell you about my bug bounty journey — it started with confusion and ended with me finding a security flaw that could delete any logged-in user’s account. 😱
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 used the session cookie to decide which account to delete while only validating the credentials supplied in the request body, without binding the two together.
Impact
An attacker could cause a logged-in victim's account to be permanently deleted with a single visit, and recovery was often impossible because notification emails were unreliable.
What the attacker needed
Victim is logged in; victim visits attacker's page; attacker has a valid account
The fix
The server should bind state-changing actions to the account identified by the server-side session and ignore arbitrary account identifiers in the POST body, and should require re-authentication for destructive actions.
How it was found
- Intercept the account deletion request and observe that it requires credentials in the POST body.
- Notice that the server deletes the account belonging to the session cookie, not the account matching the supplied credentials.
- Craft a form that submits the attacker's own valid credentials to the deletion endpoint.
- Lure a logged-in victim to visit the form, causing their session cookie to be sent with the attacker's credentials.
- The server validates the attacker's credentials and deletes the victim'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.
When you log into a website, the site gives your browser a session cookie so it knows who you are. This site's delete-account feature checked the password you typed, but then deleted whichever account was currently logged in, not the account matching that password. So an attacker could trick a logged-in victim into submitting the attacker's own password, and the site would delete the victim's account instead.
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.