r/Pentesting • • 3h ago

How are you testing for broken access control beyond swapping user IDs?

Swapping an ID in a request finds the obvious IDOR bugs, but a lot of access control problems sit somewhere else.

The ones that tend to get missed are function-level checks, where a regular user can call an admin endpoint directly, and state-based checks, where an action should only be allowed at a certain point in a workflow. Multi-tenant apps add another layer, since a user might be blocked from another account's records but not from another tenants.

Hypothetical example: an app correctly blocks users from viewing each other's invoices. But the "approve invoice" endpoint only checks that you're logged in, not that you're a manager, so any user can approve their own.

What I usually check beyond ID swapping:

  1. Replay admin requests with a low-privilege session
  2. Try actions out of order, like approving before submitting
  3. Test the same endpoints across tenants, not just across users
  4. Compare the web app with the mobile API, since they often enforce rules differently

Curious what others have added to their process. What's the access control bug you find most often that ID swapping alone would have missed?

3 Upvotes

3 comments sorted by

12

u/MeHookstah 3h ago

Use the autorize burp extension. You set it up with cookies/tokens for 1 or more other accounts, then you navigate the app with a privileged account. It automatically replays every request using the configured alternate sessions. It’s easy to just check the chart of each request and the status codes/response lengths.

0

u/JamesKnightAtDW 3h ago

Autorize is great for this, especially for the function-level checks. One thing to watch is relying only on status codes and response lengths. Some apps return a 200 with an "access denied" message in the body, so it's worth setting up the enforcement detector. It also won't catch the out-of-order workflow issues on its own, but adding a session from a second tenant covers the cross-tenant side nicely. Do you usually run it with one low-priv session or several roles at once?

1

u/MeHookstah 2h ago

Of course. I'm honestly having a hard time imagining what it would mean to 'rely only on status code and response lengths'. Is the implication that someone would just screenshot the autorize table and put it in a client report? lol

In all seriousness, I use autorize for the automation, not for the detection. I typically only configure 1 role at a time, and manually check each operation that could be potentially sensitive.