Course contentsShow
← Security
Lesson 829 of 3,05217. Web Security - Authorization and Access ControlFree lesson

Testing for Privilege Escalation

Master systematic approaches to test applications for both horizontal and vertical escalation flaws.

Testing for Privilege Escalation

What you'll learn: You'll master systematic approaches to test applications for both horizontal and vertical privilege escalation flaws.

Why Testing Matters

Understanding how privilege escalation works is only half the battle—you need structured methods to find these vulnerabilities before attackers do. Testing involves deliberately attempting to exceed your authorized permissions to verify that access controls are properly enforced.

Systematic Testing Approach

1. Map the Application's Privilege Levels

First, identify all user roles and their intended capabilities. Create test accounts for each privilege level (guest, regular user, admin, super-admin). Document what actions each role should perform.

2. Test Vertical Escalation

Using a low-privilege account, attempt to:

  • Access administrative URLs or endpoints directly (e.g., /admin, /dashboard/settings)
  • Modify parameters like role=admin or isAdmin=true in requests
  • Manipulate session cookies or tokens to inject elevated privileges
  • Chain multiple steps: register → tamper → access restricted resource

3. Test Horizontal Escalation

With one user's credentials, try to:

  • Access another user's data by changing identifiers (userId=123 → userId=124)
  • View or modify resources belonging to peers at the same privilege level
  • Execute functions that should be restricted to the resource owner

4. Test Every Entry Point

Check all interfaces: web forms, APIs, mobile endpoints, GraphQL queries. Many applications secure the UI but forget to validate permissions at the API layer.

5. Look for Context Gaps

Test multi-step processes where authorization might only be checked on the first step, allowing you to skip validation in subsequent steps.

Key Takeaway: Effective privilege escalation testing requires methodically attempting unauthorized actions from multiple accounts across all application entry points to verify that access controls are consistently enforced at every layer.