JWT Auth Gone Wild: The Unexpected Twist!
The account deletion endpoint authorised requests using a JWT supplied by the client, so swapping in another user's token deleted that user's account. An attacker who obtained a victim's JWT could delete the victim's account.
Hey everyone after a long time I am back with another bug hunting writeup. This time the bug severity is low but I am always trying to escalate it’s impact.
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 delete-account endpoint trusted the user identity from the client-supplied JWT without binding it to the authenticated session or checking that the token belonged to the requester.
Impact
An attacker who already holds a victim's JWT could delete the victim's account; the report notes obtaining that token is not directly possible, which limited severity to low.
What the attacker needed
A free account; possession of the victim's JWT
The fix
The endpoint should derive the account to delete from the authenticated session rather than trusting a client-supplied JWT, and should reject tokens that do not belong to the requester.
How it was found
- Create an account and log in, then find the delete account button in the profile section.
- Click Delete Account and capture the request.
- Replace the JWT in the authorization header with the victim's JWT.
- Observe a 200 response confirming the victim's account was deleted.
- Try to log in with the victim's valid credentials and see that login fails because the account is gone.
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.
A JWT is a signed token a website gives you after login to prove who you are. Here the delete-account request trusted whatever token was sent, so if someone else's token was used, their account was deleted instead. The report notes that getting another person's token is not easy, which is why it was rated low.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.