Skip to main content
2 min read Advanced Web

Privilege Escalation

Privilege Escalation

AspectDetails
DescriptionPrivilege escalation is when a user gains access or capabilities beyond what their role permits. Vertical escalation reaches higher privileges (user to admin); horizontal escalation reaches another user's data at the same level.
Conditions to be Vulnerable- Authorization is enforced in the UI or client only, not server-side.
- Roles/permissions are trusted from client-controlled values (cookies, JWT claims, hidden fields).
- Admin or sensitive functions lack per-request access checks.
Where to Find- Admin panels, user-management and role-assignment endpoints.
- Object references (?userId=, ?role=), mass-assignment in JSON APIs, and JWT claims.
Common Exploits- Forcing browsing to admin URLs/functions that skip server-side checks.
- Tampering role parameters or JWT claims ("role":"admin") to elevate.
- Mass assignment of isAdmin=true during profile update.
ExampleA standard user sends POST /api/profile {"email":"x@y.com","role":"admin"} and the API blindly persists role, granting admin. Or visiting /admin/users directly returns the admin page without authorization.
How to Test1. Map roles by logging in as low- and high-privilege accounts and recording requests.
2. Replay privileged requests with the low-privilege session/token (Burp Autorize).
3. Tamper role fields, JWT claims, and add extra fields to test mass assignment. Authorized accounts only.
ToolsBurp Suite (Autorize), OWASP ZAP, jwt_tool, AuthMatrix
Mitigation- Enforce server-side, deny-by-default authorization on every request and object.
- Derive roles from the server session, never from client input or unsigned claims.
- Use allowlists for bindable fields to prevent mass assignment.

Resources

CreditURL
OWASP WSTG - Testing for Privilege Escalationhttps://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/05-Authorization_Testing/03-Testing_for_Privilege_Escalation
OWASP Cheat Sheet - Authorizationhttps://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html
PortSwigger - Access control vulnerabilitieshttps://portswigger.net/web-security/access-control