Horizontal Privilege Escalation Patterns
What you'll learn: How attackers move sideways to access other users' data at the same privilege level without needing elevated permissions.
What Is Horizontal Privilege Escalation?
While vertical escalation means gaining higher privileges (normal user → admin), horizontal escalation means staying at your privilege level but accessing resources belonging to other users at the same level. Think of it like a hotel guest using their key card to open another guest's room—both are guests, but they shouldn't access each other's spaces.
Common Attack Patterns
User ID Manipulation
Attackers modify identifiers in requests to access other users' data:
GET /api/profile?userId=123 → userId=124
If the application doesn't verify that the authenticated user (you, ID 123) should access user 124's profile, the attack succeeds.
Session Context Switching
Exploiting features where user context changes without proper validation:
POST /orders/view
{ "orderId": "ORD-5001", "customerId": "456" }
Changing customerId to another value while logged in as a different customer.
Account Feature Abuse
Using legitimate features incorrectly, like viewing invoices:
GET /invoices/2024-03-invoice-789.pdf
Incrementing the invoice number to view others' financial documents.
Why This Matters
Horizontal escalation often goes unnoticed because users should have access to data at their level—just not someone else's data. Applications must verify both authentication (who you are) and authorization (what you specifically can access), not just that you're logged in.
Key Takeaway:
Horizontal privilege escalation lets attackers access peer users' resources by manipulating identifiers or context without requiring elevated permissions—every resource must verify ownership, not just authentication status.