pentesting, updated
Testing for privilege escalation
Confirm a user can't gain a higher role, or another user's data, by manipulating request parameters.
Goal
Verify no request lets a user grant themselves (or another account) elevated privileges.
How to test
Look for a role/permission value echoed back to the client, and try submitting a more privileged one on write operations:
curl -s https://example.com/api/profile -X PATCH -d '{"role":"admin"}' -H "Cookie: session=<low-priv-session>"
Also check JWTs for a role/scope claim that isn’t re-validated server-side (see JSON Web Tokens), and object-creation endpoints that silently accept extra, unintended fields (mass assignment).
What to look for
A role or permission that changes based on client-supplied input, honored without a server-side authorization check.
References
- OWASP WSTG-ATHZ-03 — Testing for Privilege Escalation.
- Related: mass assignment.