Use this when users can act outside their permissions (OWASP A01).
Broken Access Control
Broken access control (OWASP A01) lets users act outside their permissions, such as viewing others' records by changing an ID in the URL. Enforce authorization server-side on every request and deny by default.
1. Broken access control: users act outside permissions (IDOR, privilege escalation).
2. Enforce server-side on every request.
3. Deny by default.
4. Test with multiple roles.
5. Log failures.
request → server-side authorisation → allow/deny
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Checking authorization only in the UI.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Check authorization on every request server-side.
- Changing an ID in a URL must not reveal other data.
- Deny by default.
- Authorisation tests (IDOR, forced browsing) — access control
curl -H 'Authorization: Bearer <userA>' https://<api>/users/<userB-id>— IDOR test- Server-side checks on every request — deny by default
ReferenceWhy it matters1 section · depth on demand
Defences
- Deny by default; check authorisation on the server for every request and object (not only hiding buttons).
- Check ownership:
/invoice/1043must belong to the logged-in user (prevents IDOR). - Central authorisation logic instead of checks spread across handlers.
- Test with two users and swap IDs; log and alert on access-control failures.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Broken access control means users can act outside their intended permissions: viewing other users' data by changing an ID in a URL, accessing admin functions without the role, or modifying records they should only read. It is the most common serious web vulnerability.
Prevention:
| Practice | Detail |
|---|---|
| Deny by default | Every endpoint requires an explicit authorisation decision |
| Server-side checks | Never rely on hidden UI elements or client-side checks |
| Object-level authorisation | Verify the user owns or may access the specific record |
| Centralised enforcement | One authorisation component, reused everywhere |
| Tests | Automated tests that try access with wrong roles/users |
| Logging | Log access-control failures and alert on patterns |
APIs are especially affected (broken object-level authorisation), because IDs are directly exposed in requests.
Typical flaws
| Flaw | Example |
|---|---|
| IDOR / BOLA | GET /api/invoices/1043 returns another customer's invoice |
| Missing function-level check | Normal user calls /admin/deleteUser |
| Privilege escalation via parameter | role=admin accepted in a profile update |
| Forced browsing | Unlinked admin pages reachable by URL |
| CORS misconfiguration | Other sites read authenticated responses |
Test with two users of different roles and swap IDs and tokens between them.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in OWASP → Broken Access Control. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://owasp.org/www-project-application-security-verification-standard/ · confidence 94%