My First Bug-Hunting Adventure: A Privilege Escalation Tale
An API endpoint exposed pending admin invitation links to any authenticated user, regardless of role. A regular user could extract such a link, leave the team, and rejoin as an admin, then remove the original admin and take full control.
medium.com
Published on medium.com
Hey there, I’m Moussa, and welcome to the first article in my series of thrilling cybersecurity explorations! As a tech enthusiast armed with a passion for discovery, I’m embarking on a professional quest to unravel the mysteries of web applications.
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 endpoint lacked proper access control checks, returning sensitive invitation links to all authenticated users without verifying their role.
Impact
A low-privileged user could escalate to admin, remove legitimate administrators, and take full control of the team, including manipulating or deleting team data.
What the attacker needed
A regular user account; a pending admin invitation exists
The fix
The endpoint should restrict sensitive invitation links to authorised users only and validate access controls on all endpoints.
How it was found
- Log in as a regular user with no admin rights.
- Send a GET request to /api/team/current.
- Observe that the response includes pending admin invitation links.
- Extract one of the admin invitation links.
- Leave the team voluntarily.
- Use the extracted link to rejoin the team, gaining admin privileges.
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 web app had a page that showed secret invitation links for becoming an admin. Any logged-in user could see these links, even if they were not an admin. By using one of those links, a normal user could become an admin and then remove the real admin.
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.