Skip to content
Access control Write-up Beginner

Broken Access Control in Action: Exploiting Role Modification (PortSwigger Lab)

The application accepted a user-supplied role identifier in an email-change request, letting a standard user promote themselves to administrator. The attacker could then reach the admin panel and delete another user.

Cyber Indaboski Follow

Published on medium.com

How I escalated my privileges from a standard user to an administrator by exploiting a flawed access control mechanism.

Cyber Indaboski ( Blessing John), on medium.com

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 server accepted and applied a client-supplied role identifier without checking that the user was allowed to change their own role.

Impact

A standard user could escalate to administrator and then use admin functions such as deleting other users.

What the attacker needed

A standard user account; ability to intercept and modify requests

The fix

The server should ignore client-supplied role values and only allow role changes through an authorised administrative process.

How it was found

  1. Log in with the provided standard-user credentials.
  2. Go to the My Account page and submit a new email address.
  3. Intercept the email-change request in Burp Suite.
  4. Add a role identifier set to the administrator value in the JSON body.
  5. Send the modified request and observe the response showing the new role.
  6. Refresh the page, open the admin panel, and delete the target user.

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 web application should decide what you are allowed to do based on who you are, not on what your browser sends. Here the server trusted a value in the request that said which role the user had, so a normal user could simply change that value to the administrator role. This is called broken access control: the check that should stop you from giving yourself more power was missing.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.