Broken Access Control
IDOR, forced browsing, and privilege escalation in web apps: OWASP's number one risk.
Access control decides who may do what. It's the top entry in the OWASP Top 10 because it's easy to forget a single check.
1
What goes wrong
The OWASP Top 10 (2021) puts A01: Broken Access Control first. Typical bugs:
- IDOR (Insecure Direct Object Reference):
/api/orders/1042returns any order if you change the number. - Forced browsing:
/adminisn't linked for normal users, but works if you type it. - Horizontal escalation: accessing another user's data at your own privilege level.
- Vertical escalation: doing things only a higher role (e.g. admin) should do.
- Trusting the client: a
role=admincookie or a hiddenisAdminform field.
- IDOR (Insecure Direct Object Reference):
2
Fixing it
- Check permissions on the server, on every request, close to the data.
- Look records up through the current user (
WHERE id = ? AND owner_id = currentUser), not just by ID. - Deny by default; add exceptions deliberately.
- Random IDs (UUIDs) make guessing harder but are not an access control.
โ Report a problem with this room
Log in to report a problem.