Access Control Cheatsheet
Access Control Cheatsheet
Access Control Vulnerabilities Summary and Testing Guide
What Are Access Control Vulnerabilities?
Access control vulnerabilities occur when an application does not properly restrict users’ access to actions or data. This allows unauthorized users to:
- Perform admin-only functions (vertical privilege escalation).
- Access other users’ data or resources (horizontal privilege escalation).
- Exploit multi-step processes or bypass weak restrictions.
** General Reconnaissance**
- Understand the Application’s Access Model:
- Are there roles (e.g., admin, user)?
- Is user data isolated (horizontal controls)?
- Are there hidden admin-only actions?
- Map the Application:
- Identify endpoints, parameters, and cookies that control access.
- Check for predictable identifiers like
?id=123.
- Investigate HTTP Responses:
- Look for differences in
200,403, or302statuses to infer access control weaknesses.
- Look for differences in
** Horizontal Privilege Escalation Testing**
- Test query parameters:
- Modify resource IDs (e.g.,
?id=123→?id=456) to access another user’s data.
- Modify resource IDs (e.g.,
- Exploit IDOR:
- For predictable identifiers, test ranges of IDs or GUIDs leaked in the app (e.g., user profiles or API endpoints).
- Check file downloads:
- Modify file paths (e.g.,
/download/2.txt→/download/1.txt).
- Modify file paths (e.g.,
- Observe redirect behavior:
- Submit invalid and valid account IDs in endpoints (e.g.,
/my-account?id=xxx) and compare response content.
- Submit invalid and valid account IDs in endpoints (e.g.,
Vertical Privilege Escalation Testing**
- Test admin functionality:
- Access URLs like
/adminor/dashboard. - Use
/robots.txtto locate hidden paths.
- Access URLs like
- Header Manipulation:
- Add headers like
X-Original-URLor modify existing headers to bypass restrictions:1 2
GET / HTTP/1.1 X-Original-URL: /admin/delete
- Add headers like
- HTTP Method Testing:
- Try alternate methods (
GET,PUT,DELETE) to bypass controls on restricted actions.
- Try alternate methods (
- Mass Assignment:
- Add unexpected fields in requests (e.g.,
roleID) and observe changes:1 2
POST /update {"email": "user@example.com", "roleID": "1"}
- Add unexpected fields in requests (e.g.,
- Multi-Step Processes:
- Test if each step of a multi-step workflow enforces access controls individually.
** Advanced Techniques**
- Referer Header Bypass:
- If
Refereris checked, spoof it:1
Referer: https://vulnerable-app.com/admin
- If
- Source Code Inspection:
- Look for client-side scripts revealing admin URLs or sensitive parameters.
- Cookie Modification:
- Identify cookies controlling roles (e.g.,
Admin=false) and modify them (e.g.,Admin=true).
- Identify cookies controlling roles (e.g.,
- Location-Based Restrictions:
- Test geolocation or IP-based controls using proxies or VPNs.
Common Testing Scenarios by Business Context
1. E-commerce
- Test
?order=1234to access others’ orders. - Identify unprotected admin actions managing orders or refunds.
2. Healthcare
- Check for cross-tenant data leaks, e.g., switching session cookies or user IDs.
3. Banking
- Modify account numbers in endpoints (
?account=5678) to access unauthorized funds or details.
4. SaaS Platforms
- Attempt to access premium or admin features as a regular user.
Step 5: Automation and Tools
- Burp Suite:
- Use Intruder to fuzz endpoints with predictable IDs or parameters.
- Compare site maps across roles to identify differences.
- Wordlists:
- Use wordlists to brute-force sensitive paths (
/admin,/dashboard,/settings).
- Use wordlists to brute-force sensitive paths (
- HTTP Method Checks:
- Automate method-based bypass testing (
GET,POST,DELETE).
- Automate method-based bypass testing (
- Header Testing:
- Test custom headers (
X-Original-URL,X-Rewrite-URL) systematically.
- Test custom headers (
This post is licensed under CC BY 4.0 by the author.