Why Broken Access Control is #1 on OWASP
Broken Access Control moved to the #1 position in OWASP Top 10 (2021), up from #5. This reflects the reality that access control flaws are pervasive, difficult to detect with automated tools alone, and often lead to severe consequences including data breaches and privilege escalation.
Access control determines what authenticated users are allowed to do. When it fails, users can access data or perform actions outside their intended permissions.
Types of Access Control Flaws
Insecure Direct Object References (IDOR)
The most common pattern. Applications use predictable identifiers to reference objects:
GET /api/invoices/1001 -> Your invoice
GET /api/invoices/1002 -> Someone else's invoice (IDOR!)
Why it happens: Developers assume that because a user is authenticated, they're authorized for any object they request. Authentication and authorization are conflated.
Vertical Privilege Escalation
A regular user accesses administrative functionality:
# Normal user discovers admin endpoint
GET /api/admin/users -> Should be 403, returns all users
POST /api/admin/delete-user -> Should be 403, deletes a user
Horizontal Privilege Escalation
A user accesses another user's resources at the same privilege level:
# User A's session accessing User B's data
GET /api/users/userB/documents -> Returns User B's documents
PUT /api/users/userB/profile -> Modifies User B's profile
Forced Browsing
Accessing pages or files by guessing URLs:
/admin/dashboard -> Admin panel (no auth check)
/backup/database.sql -> Database dump (directory listing)
/api/debug/config -> Application configuration
Path Traversal
Manipulating file paths to access restricted files:
GET /api/files?path=../../../etc/passwd
GET /api/download?file=../../config/database.yml
Testing Methodology
Step 1: Map the Application
Document every endpoint, parameter, and user role:
- List all API endpoints and their HTTP methods
- Identify resources that belong to specific users
- Map role-based access (admin, manager, user, guest)
- Note any multi-tenant boundaries
Step 2: Test Horizontal Access
For each resource endpoint:
- Authenticate as User A
- Note the resource IDs in responses
- Replace IDs with those belonging to User B
- Check if the response returns User B's data
Step 3: Test Vertical Access
For each role-restricted endpoint:
- Authenticate as a low-privilege user
- Send requests to admin/manager-only endpoints
- Check if functionality executes or data is returned
- Test with modified JWT claims or session parameters
Step 4: Test Parameter Tampering
# Original request
POST /api/profile {"name": "John", "email": "john@example.com"}
# Tampered request
POST /api/profile {"name": "John", "email": "john@example.com", "role": "admin", "is_verified": true}
Step 5: Test Missing Function-Level Access Control
- Try accessing API endpoints without authentication headers
- Test with expired or revoked tokens
- Check if OPTIONS/HEAD methods bypass auth
- Look for debug endpoints without protection
Prevention Strategies
1. Deny by Default
Every endpoint should require explicit authorization. If no rule grants access, deny it.2. Centralized Authorization
Don't scatter access control logic across controllers. Use middleware or decorators:@require_role("admin")
@require_ownership("user_id")
def update_user(user_id, data):
...
3. Use Indirect References
Map internal IDs to per-session random tokens:# Instead of: GET /api/invoices/1001
# Use: GET /api/invoices/a7f3e2b1 (session-specific mapping)
4. Automated Testing in CI/CD
Integrate access control tests into your pipeline to catch regressions early.SuperClue Access Control Testing
SuperClue provides automated IDOR and access control testing:
- Object ID manipulation on discovered API endpoints (BOLA/IDOR)
- Privilege escalation and function-level authorization tests (BFLA)
- JWT claim tampering and token manipulation
- Forced browsing and directory enumeration
Don't let broken access control expose your users' data.