How I Hacked a Reading App and Gained Admin Privileges
The profile update endpoint accepted an isAdmin field in its JSON body without validation, letting a normal user grant themselves administrator rights. The attacker then found an admin subdomain and logged in with the elevated account to access all user and content management functions.
medium.com
Published on medium.com
Hi, I’m Atakan. I work as a Security Researcher at HackerOne, and I recently identified a simple, yet highly impactful vulnerability that allowed me to elevate my privileges to that of an administrator within a reading application.
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
The profile update endpoint processed a privileged field (isAdmin) from user-supplied JSON without validating or stripping it, unlike the registration endpoint.
Impact
An attacker could gain full administrative access, including viewing all users and managing users, books and authors.
What the attacker needed
A normal user account; ability to log in via Google Sign-In
The fix
The profile update endpoint should validate and ignore privileged fields such as isAdmin, as the registration endpoint already did; the text says a fix was deployed.
How it was found
- Register a normal account and log in via Google Sign-In.
- Send a PUT request to the profile update endpoint with a JSON body that includes an isAdmin field set to true.
- Observe that the server accepts the request and the account becomes an administrator.
- Run subdomain enumeration to find the admin panel subdomain.
- Log in to the admin panel with the now-elevated account.
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.
When you sign up or edit your profile, the app sends your details to the server as structured data. This app checked that data during sign-up but not during profile editing, so a user could sneak in an extra field that marked their account as an administrator. That gave them the same powers as the site's staff.
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.