From Zero to Hero: How I Uncovered a Critical Privilege Escalation Flaw and Earned $500
The application used a weak JWT secret and trusted a role claim in the token, allowing the author to change their role from user to admin and access the admin dashboard. This gave full admin privileges, including access to user data and deletion controls.
cybersecuritywriteups.com
Published on cybersecuritywriteups.com
Privilege escalation vulnerabilities are like hidden trapdoors in applications — waiting for the right (or wrong) person to stumble upon them. For ethical hackers, these flaws are golden opportunities to secure systems and earn bounties.
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 JWT signing secret was weak and guessable, and the server trusted the role claim in the token without additional server-side validation.
Impact
The attacker could access the admin dashboard and gain full admin privileges, including access to user data, settings, and deletion controls.
What the attacker needed
A user account; ability to intercept requests
The fix
The application should use a strong, unpredictable JWT secret and validate roles server-side.
How it was found
- Intercept the profile update request using Burp Suite.
- Decode the JWT using jwt.io.
- Change the role claim from user to admin.
- Re-sign the token with the weak secret key.
- Send the request with the modified token to access the admin dashboard.
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 JSON Web Token (JWT) is like a signed ID card that the server gives you after login. The server should check the signature to ensure the card is genuine, but here the secret used to sign it was easy to guess. The author guessed the secret, changed the role written on the card to 'admin', re-signed it, and the server accepted it, letting them into the admin area.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.