Broken access control

On this page 8

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.

PatternWhat goes wrongAttacker outcome
IDORObject ID accepted without ownership checkReads or edits other users’ records
Missing function-level checkAdmin endpoint lacks role verificationRuns privileged operations
Vertical privilege escalationRole taken from client parameter or token claimGains administrator rights
Horizontal privilege escalationPeer accounts not separatedActs as another user of the same level
Forced browsingUnlinked pages assumed hiddenReaches unprotected pages directly
CORS misconfigurationTrusted origins too broadCross-site reads of sensitive responses
Path traversalFile paths not constrainedReads files outside the intended folder
Common forms of broken access control

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.

ModelDecision basisStrengthTypical weakness
RBACUser rolesSimple to auditRole explosion, no ownership logic
ABACAttributes of user, resource, contextFine-grained rulesComplex policy testing
ReBACRelationships between entitiesNatural for sharing and teamsGraph queries add latency
ACLPer-object permission listsPrecise per resourceHard to manage at scale
Authorization models and their typical fit

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 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.

VulnerabilityCore question it breaksRelationship
Broken authenticationWho is the callerPrecedes authorization; separate category
IDORDoes the caller own this objectSubtype of broken access control
CSRFDid the user intend this requestAbuses valid permissions, not missing ones
SSRFMay the server fetch this targetServer-side reach rather than user rights
Session hijackingIs this session still the user’sSteals identity, then exploits valid access
How related vulnerabilities differ

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, DELETE or PATCH where only GET was intended to be allowed.
  • Log review: monitor repeated 403 responses 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.

SituationRecommended controlReason
Users own recordsFilter queries by owner ID on the serverPrevents IDOR by construction
Admin functions existSeparate route group with enforced role checkStops vertical escalation
Multi-tenant SaaSTenant ID in every query and indexBlocks cross-tenant leakage
Tokens carry claimsVerify signature and re-check server stateClaims can be stale or forged
Static files servedAuthorize through the application layerDirect URLs bypass checks
Rapid feature growthCentral policy engine with testsKeeps rules consistent
Recommended controls by situation

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.