Bind Every Object Operation to the Caller
Compare route model binding with an authorized lookup and close permission gaps between neighboring endpoints.
You’re reading a preview. Premium includes the full lesson and specialist practice. View the full curriculum.
A valid identifier is a selection, not a permission
Broken Object Level Authorization (BOLA) occurs when an API performs an operation on a selected object without enforcing the caller's permission for that object. An insecure direct object reference, or IDOR, is a common way this becomes visible: changing an identifier selects someone else's record. Sequential numbers make discovery easier, but unpredictable identifiers do not establish authorization either.
Consider PocketBooks, a small account API. Nia owns account 17; Arun owns account 29. Both users can sign in. Nia is allowed to view account 17's balance and recent entries. She is not allowed to view account 29's entries. The policy concerns the relationship between the verified user and the selected account, not whether the account exists.
GET /api/accounts/29/entries HTTP/1.1
Authorization: Bearer <Nia's valid credential>
An authentication middleware may correctly accept Nia's credential. A rate limiter may also work. If the handler returns Arun's entries, neither earlier control supplies the missing object permission.