JavaScript analysis leading to Admin portal access
An admin API endpoint accepted a JWT issued to a non-privileged user and returned another JWT, which then granted access to other admin endpoints. An attacker with a normal account could therefore reach admin functionality.
Published on rikeshbaniyaaa.medium.com
I love hunting on small scoped websites cause i can be assured that i have seen every corner and analyzed every endpoint of the that website
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
Impact
A non-privileged user could obtain an elevated token and access admin endpoints, potentially exposing user data such as names, ages and phone numbers.
What the attacker needed
A normal user account; access to the main site
The fix
The admin endpoint should verify that the caller's JWT has admin privileges before returning any token or data.
How it was found
- Find the meUser endpoint on the main site.
- Download and read the JavaScript files to discover an admin endpoint.
- Send the ordinary user's JWT to that admin endpoint.
- Receive a new JWT in the response.
- Use the new token to call other admin endpoints such as GetUser and GetLocation.
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 a signed piece of data a site gives you after login to prove who you are. Here the admin part of the site trusted a token meant for ordinary users and handed back a more powerful token. That let a normal user act like an 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.