Skip to content
Access control Write-up Intermediate

Phase 2 : React JS, JS Files, and Hidden API Mapping

The backend of an admin portal only checked that a token was valid, not what role it carried, so a normal user registered through the mobile app could call admin endpoints. The attacker could add their own account as Super Admin and take over two admin portals that shared the same API.

Amrul Follow

Published on medium.com

Hey, I’m Amrul. I work as a Security Engineer, and in my free time I do bug bounty on YesWeHack.

Amrul, 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 backend enforced role-based access control only on the login API and then trusted any valid token for all other endpoints, without checking the user's role.

Impact

A normal user could become Super Admin and manage all users, change roles, access sensitive data and control system configuration across two admin portals.

What the attacker needed

A normal account via the mobile app; mobile app traffic interception; bypassing SSL pinning and root detection

The fix

The backend should enforce role-based authorization on every endpoint, not just at login, and isolate roles between portals.

How it was found

  1. Register a normal user through the mobile app.
  2. Log in to the backoffice portal with those credentials; the UI login fails but the /user/v2/me request succeeds.
  3. Use the normal user token against admin endpoints extracted from the backoffice JavaScript files.
  4. Send a request to the ACL endpoint that sets the account's role to Super Admin.
  5. Use the escalated token to access the second portal that shares the same backend.

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 token is a small piece of proof that you are logged in. The server should also check what you are allowed to do, not just that you are logged in. Here it forgot that second check, so a normal user could do admin things.

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 Amrul

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.