Deleting any user’s account from the platform via exposed /admi
A hidden admin endpoint for managing users was accessible to normal users, allowing them to delete any account by changing the userId parameter. An attacker could delete any user's account on the platform.
I was testing this application where as a normal user you can report other user’s on the platform which maybe sending spam messages or commenting on your projects and causing issues.
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 did not check that the user making the request had administrator privileges, so any authenticated user could call the admin endpoint.
What the attacker needed
A normal user account; ability to inspect web pages
The fix
The issue was fixed by adding proper authorization checks, as the endpoint now returns a 403 error for unauthorized users.
How it was found
- As a normal user, open the report form and inspect the page source to find a hidden form for blocking or deleting user accounts.
- Note the endpoint and parameters used by the hidden form.
- Send the request to a tool like Repeater, replacing cookies and CSRF token with those from the normal user's account.
- Change the userId parameter to the victim's user ID and send the request.
- Observe that the victim's 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 write-up has not been written yet. The Original tab links to the source.
The website had a special form meant only for administrators to delete user accounts, but it was hidden in the page's code and not properly protected. A normal user could find this form, change the user ID to someone else's, and delete that person's account. This is a serious access control mistake.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.