Privilege Escalation to Admin through an Import Feature
A student user could import users via a CSV feature intended for admins, and by setting the role parameter to admin and using an existing email, they could escalate their own privileges to admin.
Published on cristivlad.medium.com
I usually skip the introduction when posting a writeup because I don’t need to teach you what privesc or BOLA are, you can google that yourself.
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 import feature lacked proper authorization checks and allowed updating existing users' roles without validation.
Impact
A student could escalate their privileges to admin, gaining full access to the application.
What the attacker needed
A student account; ability to intercept requests
How it was found
- As an admin, add a user through the import feature and intercept the request.
- Replace the admin session token with that of the student; the import succeeds.
- Notice a parameter willUpdate set to true, suggesting existing users can be updated.
- As student, repeat the request using your registered email and set the role parameter to admin.
- Refresh the student dashboard to see admin features.
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 app had a feature for admins to add users by uploading a CSV file. A student account could also use this feature, and by changing the role field in the CSV to 'admin', the student could make themselves 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.