Skip to content
Access control Write-up Beginner

# From “users” to “admin”: How a Simple Response Copy-Paste Led to Privilege Escalation

The profile update endpoint accepted a client-supplied role field, allowing any authenticated user to change their own role to admin. The attacker could then access the admin panel and manage other users, roles, and workspace settings.

pankaj_73968 Follow

Published on medium.com

While updating my profile as a normal user, the API response included a role field set to ”users”. I copied that exact value into the request body, changed it to ”admin”, and the server happily promoted me.

Pankaj Kumar Yadav, 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

The server trusted a client-controlled role field in the profile update request and did not verify that the user was allowed to change their own role.

Impact

Any authenticated user could self-promote to admin and gain full administrative access, including viewing all accounts, modifying roles, accessing audit logs, and managing workspace settings.

What the attacker needed

A standard user account; ability to intercept HTTP requests

The fix

The role field should be read-only in profile update endpoints, and server-side role-based access control checks should be enforced before processing privileged actions.

How it was found

  1. Log in as a normal user and observe the profile response containing the role field.
  2. Intercept the profile update request.
  3. Copy the server's JSON response into the request body and change the role value to admin.
  4. Send the request and observe a successful update.
  5. Refresh the page to see the admin panel link and access 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.

A normal user could edit their profile and sneak in an extra field that says they are an administrator. The server believed it without checking, so the user became an admin and could see and change everything.

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.

More by pankaj_73968

View all

1 more disclosed report, best first.

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.