Broken access control is a class of application security vulnerabilities in which software fails to enforce authorization rules, allowing users to read data, change records or invoke functions that their role or ownership should not permit. In cybersecurity it describes the gap between what a user is authenticated as and what that user is actually allowed to do.
The category has ranked first in the OWASP Top 10 since the 2021 edition, because authorization logic is specific to each application and cannot be fully delegated to a framework or a scanner. Typical forms include insecure direct object references (IDOR), missing function-level checks, privilege escalation and misconfigured cross-origin or file permissions.
How access control fails in an application
Access control fails when the server trusts input or context that the client controls instead of evaluating a policy for every request. Authentication answers who the caller is; authorization must then answer whether that identity may perform this action on this specific resource, and broken access control means the second answer is missing, incomplete or wrong.
Most failures follow one of a few recurring patterns. A developer checks permissions in the user interface but not in the API, an endpoint accepts an object identifier without verifying ownership, or a role flag sent by the browser is believed by the server. Each pattern reflects the same root cause: enforcement placed in the wrong layer.
The table below summarizes the principal failure patterns and what an attacker gains from each.
| Pattern | What goes wrong | Attacker outcome |
|---|---|---|
| IDOR | Object ID accepted without ownership check | Reads or edits other users’ records |
| Missing function-level check | Admin endpoint lacks role verification | Runs privileged operations |
| Vertical privilege escalation | Role taken from client parameter or token claim | Gains administrator rights |
| Horizontal privilege escalation | Peer accounts not separated | Acts as another user of the same level |
| Forced browsing | Unlinked pages assumed hidden | Reaches unprotected pages directly |
| CORS misconfiguration | Trusted origins too broad | Cross-site reads of sensitive responses |
| Path traversal | File paths not constrained | Reads files outside the intended folder |
Access control models and where checks belong
Correct authorization starts with an explicit access control model that defines subjects, resources, actions and the rules that connect them. The choice of model shapes how easily rules can be audited and how likely gaps become as the application grows.
| Model | Decision basis | Strength | Typical weakness |
|---|---|---|---|
| RBAC | User roles | Simple to audit | Role explosion, no ownership logic |
| ABAC | Attributes of user, resource, context | Fine-grained rules | Complex policy testing |
| ReBAC | Relationships between entities | Natural for sharing and teams | Graph queries add latency |
| ACL | Per-object permission lists | Precise per resource | Hard to manage at scale |
Whatever the model, checks must run on the server for every request, close to the data access layer. A widely used rule is deny by default: a request is rejected unless a policy explicitly allows it, so a forgotten rule produces an error rather than an exposure. Centralizing decisions in a single policy component reduces the risk that one endpoint implements a weaker version of the logic.
Broken access control compared with related flaws
Broken access control overlaps with several neighboring vulnerabilities, and precise naming helps teams route findings correctly. The key distinction is whether the flaw concerns identity, permission or input handling.
| Vulnerability | Core question it breaks | Relationship |
|---|---|---|
| Broken authentication | Who is the caller | Precedes authorization; separate category |
| IDOR | Does the caller own this object | Subtype of broken access control |
| CSRF | Did the user intend this request | Abuses valid permissions, not missing ones |
| SSRF | May the server fetch this target | Server-side reach rather than user rights |
| Session hijacking | Is this session still the user’s | Steals identity, then exploits valid access |
The practical consequence is that fixing authentication does not fix authorization. Strong passwords, multi-factor login and secure session handling still leave an application exposed if any endpoint omits its ownership or role check.
Detecting and testing authorization flaws
Authorization flaws are difficult for automated scanners because a scanner cannot know which user should see which record. Effective detection therefore combines manual testing with multiple accounts, code review of policy logic and targeted automated tests in the build pipeline.
- Two-account testing: perform an action as user A, replay the request with user B’s session, and expect a denial.
- Role matrix tests: enumerate every endpoint against every role and assert the expected allow or deny result.
- Identifier tampering: change numeric, sequential or predictable IDs in paths, bodies and headers.
- Method switching: try
PUT,DELETEorPATCHwhere onlyGETwas intended to be allowed. - Log review: monitor repeated
403responses or access to many object IDs from a single session.
Unpredictable identifiers such as UUIDs make enumeration harder but are not an access control mechanism. They reduce discoverability while leaving the underlying missing check in place, so a leaked or logged identifier still grants access.
Preventing broken access control in practice
Prevention depends on design discipline more than on tools, because every new endpoint and data relationship introduces a new authorization decision. The decision table below maps common situations to a recommended control.
| Situation | Recommended control | Reason |
|---|---|---|
| Users own records | Filter queries by owner ID on the server | Prevents IDOR by construction |
| Admin functions exist | Separate route group with enforced role check | Stops vertical escalation |
| Multi-tenant SaaS | Tenant ID in every query and index | Blocks cross-tenant leakage |
| Tokens carry claims | Verify signature and re-check server state | Claims can be stale or forged |
| Static files served | Authorize through the application layer | Direct URLs bypass checks |
| Rapid feature growth | Central policy engine with tests | Keeps rules consistent |
Complementary measures include rate limiting on object lookups, least privilege for service accounts and database users, and audit logging of authorization denials so that probing becomes visible to the security operations team.
Common mistakes that reintroduce the flaw
Teams often fix one instance of broken access control and then reintroduce the same pattern elsewhere. Recurring mistakes include hiding buttons instead of blocking requests, trusting a role field in a JSON body, caching responses without user-specific keys, and adding new API versions that skip the middleware applied to older routes.
Another frequent error is treating GraphQL or batch endpoints as a single permission unit. Each field or nested object can expose a different resource, so authorization must apply per resolver or per object, not only at the entry point.
Put simply
Broken access control means an application checks who a person is but not what that person may touch. Picture a hotel that checks a guest at the front desk. It then hands over a key card that opens every room on the floor.
The fix is to make each door check the key. Then every request is verified against clear rules. Those rules say who owns what and who may do what.
In practice
An online invoicing service lets customers download invoices from a URL such as /api/invoices/48213. During a routine penetration test, a tester logged in as one customer changes the number to 48214 and receives another company’s invoice, including names, addresses and amounts. The server checked that the caller was logged in but never compared the invoice owner with the caller’s account.
The development team adds a server-side ownership filter to every invoice query, introduces a shared authorization function used by all invoice endpoints, and writes automated tests that replay requests across three test accounts and two roles. They also start logging denied requests and alerting when one session requests more than 50 different invoice IDs within ten minutes.
The retest finds no cross-account access, and the new tests catch a similar mistake in a report export feature before it reaches production.