Authorization Bypass via Privilege Persistence After Role Downgra
An administrator whose role was downgraded to member could still perform privileged GraphQL mutations using an existing authenticated session. This allowed a downgraded administrator to remove project members despite no longer having the required permissions.
Published on medium.com
Hi, I’m Ahmed Embaby (0xembaby), a Cybersecurity Researcher specializing in Web & Network Penetration Testing, Vulnerability Research, and Offensive Security. My work focuses on identifying authorization flaws, business logic vulnerabilities, authentication issues, GraphQL security weaknesses and other high-impact…
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 authorization layer relied on privilege information embedded in the existing session token instead of checking the user's current role in the database on each request.
Impact
A user who no longer held administrative permissions could continue performing privileged GraphQL mutations using an existing authenticated session, breaking the principle of least privilege.
What the attacker needed
A test project with three users; administrator session token; owner account to downgrade role; ability to intercept requests
The fix
The authentication was migrated to a webhook-based model that validates the user's current state against the database on every request, so role changes take effect immediately.
How it was found
- Create a test project with three users: Owner, Administrator, and Member.
- Log in as the Administrator and intercept the GraphQL mutation to remove the Member, keeping it pending.
- Log in as the Owner and downgrade the Administrator to Member.
- Reissue the previously captured request using the same session.
- Observe that the server accepts the request and removes the member.
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 someone's role is changed from admin to regular user, the system should immediately stop letting them do admin things. Here, the system kept trusting the old login session, so the person could still delete members even after being demoted. This is like keeping a key to a room after you've been told you're no longer allowed in.
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.