Broken Access Control
What you'll learn: You'll discover how flaws in authorization logic let users bypass permission boundaries and access data or functions they shouldn't be able to reach.
The Core Problem
Broken Access Control occurs when your application fails to properly enforce who can do what. Authentication tells you who someone is (via login), but authorization determines what they're allowed to access. When authorization checks are missing, inconsistent, or poorly implemented, attackers can manipulate requests to access other users' data, administrative functions, or restricted resources.
How It Happens
Think of it like a hotel: you have a room key (authentication), but what if you could use it to open any room? That's broken access control.
Common mistakes include:
- Missing checks entirely: An admin panel URL exists at
/admin, but the server never verifies if you're actually an admin before serving it - Client-side enforcement only: Hiding a button in the UI doesn't stop someone from crafting the HTTP request directly
- Predictable identifiers: Your account page is
/account?id=1234, so changing it toid=1235shows someone else's data - Horizontal privilege escalation: Regular users accessing other regular users' resources
- Vertical privilege escalation: Regular users performing admin actions
This overlaps with IDOR (which you just learned), but Broken Access Control is broader—it includes role-based failures, missing function-level checks, and metadata exposure.
Prevention
Always enforce authorization server-side for every request. Verify the current user has permission for the specific resource and action. Use role-based or attribute-based access control systems. Default to denying access unless explicitly granted.
Key Takeaway: Broken Access Control happens when you fail to verify user permissions server-side at every access point, allowing attackers to reach resources and functions beyond their legitimate authority.