Skip to content
Access control Write-up Beginner

BAC (Privilege Escalation): How a Simple Method Swap Exposed Sensitive Admin Data

A restricted user could read sensitive admin data by changing a blocked PATCH request to a GET request on the same endpoint. The API did not enforce authorization for the GET method, exposing admin names, emails and internal user details.

0xmostafa Follow

Published on 0xmostafa.medium.com

Access control is the backbone of any SaaS platform. When it fails, even the most robust-looking systems can leak private data.

Mostafa Muhammed, on 0xmostafa.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 API enforced authorization only for the PATCH method and not for GET on the same endpoint.

Impact

A restricted user could enumerate every admin in the organization, see their real names, private emails and last activity timestamps, which could aid targeted phishing.

What the attacker needed

A low-privileged account; knowledge of the endpoint

The fix

Authorization should be checked for every HTTP method at the API layer, not just for modifying requests.

How it was found

  1. As Super Admin, capture the PATCH request to the user endpoint.
  2. Downgrade the account to a restricted Logs Read-Only role.
  3. Resend the PATCH request and observe a 403 Forbidden response.
  4. Change the HTTP method from PATCH to GET and send the request.
  5. Observe a 200 OK response containing admin data.
  6. Modify the query parameter include_application_users to true to expand the data returned.

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 API uses different HTTP methods like GET (read) and PATCH (update). The server checked permissions for PATCH but forgot to check them for GET, so a low-privilege user could read data they should not see.

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 0xmostafa

View all

2 more disclosed reports, 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.