IDOR vs BOLA: Object-Level Authorization Explained
Two names for the same core mistake: trusting an identifier without checking who owns the object.
The same flaw, two names#
IDOR (Insecure Direct Object Reference) is the traditional web term. BOLA (Broken Object Level Authorization) is the term used for APIs in the OWASP API Security list. In practice both describe the same failure: the application accepts an object identifier from the client and returns or changes that object without checking that the caller is allowed to access it.
A simple example#
A signed-in user opens their invoice at /api/invoices/1042. If changing the number to 1043 returns someone else's invoice, the server verified who you are but not whether this invoice is yours.
Why it is easy to miss#
The application works normally for honest users. Scanners rarely detect it because they do not know which objects belong to which account. It usually takes two test accounts and a person who understands the data model.
Common variations#
- The identifier is in the URL, a query string, a request body or a header.
- Read access is protected but update or delete access is not.
- Identifiers are guessable, such as sequential numbers.
- A related object (for example an attachment) is not protected even when the parent record is.
How to prevent it#
- Check ownership or permission on the server for every object access, using the authenticated user, not a client-supplied user or tenant value.
- Centralize the policy check so it cannot be forgotten on a new endpoint.
- Return the same response for missing and forbidden objects.
- Use unpredictable identifiers as defense in depth. They do not replace the access check.
- Add automated tests that call each endpoint as a different user.
How testing helps#
An assessment tests each object type with accounts in different roles and tenants, then reports exactly which requests cross the boundary. A retest confirms the fix covers every route to the same data.