Field note · Access control
Broken object-level authorization — IDOR, or BOLA in the API world — is the single flaw I find most often, and the one that leaks the most. Here is why it hides so well, and the server-side pattern that ends it.
By Martin Mwathi, Orvantis Security · Published 20 October 2026 · Original research · 7 min read
A login proves who you are. It says nothing about what you are allowed to touch. Those are two different questions, and the second one — authorization — is where modern applications quietly fall apart. The system checks your token, sees a valid user, and then hands you whatever record number you asked for. It never stops to ask whether that record is yours.
This is broken object-level authorization. The web world has called it IDOR — an insecure direct object reference — for twenty years; the API security world calls it BOLA and ranks it number one for a reason. It is also the finding I reproduce most often, across web apps, mobile backends, and internal APIs alike. It is rarely exotic. It is almost always the same missing line.
Authentication is not authorization. Proving you are a user is not proof you may touch this object.
Almost every instance below is the same mistake wearing a different coat: the endpoint confirms the caller is logged in, and then treats “logged in” as permission to act on any object whose identifier appears in the request. The gate checks the badge at the door and never asks which room the badge opens.
The archetype. An endpoint like GET /api/orders/{id} reads the order by its id and returns it — after confirming the caller is logged in, but without confirming the order belongs to them. Swap your id for the one next to it and the data arrives with a clean 200. I reproduce this against record detail, document download, profile, and “export” endpoints more than any other single flaw.
Auto-incrementing integers turn a single leaked object into an enumeration of all of them: 1040, 1041, 1042. When the id is predictable and the ownership check is missing, a half-day script walks the entire table. The id being guessable is not itself the bug — but it decides whether the real bug leaks one record or the whole database.
A random, unguessable identifier is not an access control; it is an access control someone forgot to write, hidden behind the hope that nobody will see the id. But ids leak constantly — in shared links, referrer headers, logs, emails, mobile caches, support tickets, a colleague’s screen. The moment one is observed, an unguessable id with no server-side ownership check is exactly as exposed as a sequential one.
The read side gets attention; the write side is where it gets expensive. An update endpoint that binds the whole request body to the record lets a caller send fields they were never meant to control — owner_id, account_id, role, is_admin. Now the attacker doesn’t just read another object; they reassign it, or promote themselves. Same root cause, worse ending.
The obvious endpoint is guarded, but the nested or downstream one isn’t: /reports/{id}/download, /account/{id}/invoices, a webhook replay, a batch export that takes a list of ids. Authorization gets applied at the front door and forgotten on every side entrance. Each distinct path to an object needs its own check — a guard on the lobby does nothing for the loading dock.
Object-level’s sibling: broken function-level authorization. The admin-only action — delete any user, change any setting, read the audit log — is hidden in the UI but reachable by any authenticated caller who simply sends the request. The endpoint exists; nothing checks that the caller holds the role it assumes. “Not shown” is not “not allowed.”
Teams sometimes file these under “low — you need an account to do it.” That reasoning is backwards. An account costs nothing to create; what a BOLA buys is every other account’s data from inside a single ordinary one. There is no privileged position to reach first, no exploit chain to assemble — just a number, changed, in a request the attacker was already allowed to send. The blast radius is the whole table, the evidence left behind looks like normal traffic, and the data involved is usually the data that regulators and customers care about most. That is why it sits at the top of the OWASP API Security list, and why I treat it as critical until proven otherwise.
Methodically, and only against systems I’m authorized to test. I create two accounts I control — account A and account B — and build a map of every object A can reach: the ids, the endpoints, the read paths and the write paths, the exports, the nested routes. Then I ask one question of each, as account B: can I touch A’s object? I vary the id in the path, the query string, the body, and the headers; I try the write side as hard as the read side; I check whether removing the id, nulling it, or sending an array changes the answer. Every hit is reproduced at least twice and independently re-verified before it is written down. Nothing destructive, no bulk harvesting of real data — proving one crossed boundary is the finding; emptying the table is not part of the job.
The backends that hold up share one trait: authorization is not a thing each endpoint remembers to do — it is a thing the system cannot forget to do.
403, not a leak.owner_id and role are not among them.The durable fix is not “add an if after the lookup.” It is to make the lookup itself incapable of returning something that isn’t yours. Fetch filtered by owner; if nothing comes back, it was never yours to see. Example is Go, but the principle is language-independent.
// WRONG: authenticates the caller, then trusts the id.
// order := db.GetOrder(id) // returns ANY order
// return order
// RIGHT: the caller's identity is part of the query.
order, err := db.QueryRow(
`SELECT * FROM orders WHERE id = $1 AND owner_id = $2`,
id, currentUser.ID,
)
if err == sql.ErrNoRows {
return forbidden(w) // not yours (or doesn't exist) — same answer
}
Return the same response for “not yours” and “doesn’t exist” — a 404 that turns into a 403 for ids that are real is itself an existence oracle. For the write side, bind only the fields the caller may set:
// Bind to a narrow DTO — not the stored model.
type OrderPatch struct {
Notes *string `json:"notes"`
Address *string `json:"address"`
} // no owner_id, no role, no is_admin
// ...then apply the patch to an order already scoped to currentUser.ID.
And put the decision in one place every request flows through, so a new endpoint inherits the policy instead of re-implementing it:
if !policy.Allow(currentUser, "read", order) {
return forbidden(w) // deny-by-default; one place to reason about
}
Three moves cover the field: scope every read to the caller, allow-list every write, and route both through one deny-by-default policy. Do that and the number in the URL stops being a key to the building.
I test at the API layer, the way a locksmith ignores the handle and goes for the pins. Every finding is reproduced — at least twice, and independently re-verified — before it’s written down; what can’t be demonstrated is recorded as a negative, not carried as a vulnerability to pad a count. All live testing happens only against systems I’m authorized to test, on accounts I create for the purpose, with no bulk data harvesting and no destructive operations. Findings go to the owner first, on a coordinated timeline, before anything is ever said in public.
Related reading: the authentication failures behind the same APIs, and the attack surface a mobile app hands over.
Same rigor, your target. Independent, evidence-based, and never softened.