pentesting, updated
Test role definitions
Confirm each role can do exactly what it should — no more, no less — by probing horizontal and vertical escalation.
Goal
Verify the app’s roles are enforced server-side and can’t be escalated or crossed.
How to test
List every role the app defines, then for each one try to reach functionality and data outside it:
- Horizontal — access another user’s data at the same privilege level (swap an ID in a request while logged in as a different user of the same role).
- Vertical — reach a higher-privilege role’s functionality from a lower one (call an admin endpoint directly as a normal user).
curl -s https://example.com/api/user/124/profile -H "Cookie: session=<user-123-session>"
curl -s https://example.com/api/admin/users -H "Cookie: session=<regular-user-session>"
What to look for
Any response that returns another user’s data, or any admin action that succeeds from a lower-privileged session.
Notes
This overlaps heavily with authorization testing — this check is about mapping what roles exist and what each is meant to do; the bypass techniques live there.
References
- OWASP WSTG-IDNT-01 — Test Role Definitions.