BOLA Explained: The API Flaw Behind Most Data Leaks

Why broken object level authorization keeps topping API breach reports, and how testers find it.

BOLA Explained: The API Flaw Behind Most Data Leaks
IN SHORT
  • BOLA happens when an API returns an object without checking the caller is allowed to see it.
  • Scanners rarely find it, because every vulnerable request looks valid.
  • The fix is an ownership check on every object, enforced on the server, tested as two users.

Broken Object Level Authorization (BOLA) sits at the top of the OWASP API Security Top 10 for a simple reason: it is easy to introduce, hard to spot in code review, and it exposes exactly the data attackers want.

This article explains what BOLA looks like in practice, why automated tools miss it, how our testers find it, and the controls that close it for good.

PART 01

What BOLA looks like

An API exposes an object by ID: GET /api/invoices/18342. The server checks that the caller is logged in, then returns the invoice. It never checks that invoice 18342 belongs to the caller. Change the ID and you read someone else’s data. The same pattern appears in updates and deletes, where the impact is even worse.

WHY IT MATTERSAuthentication answers “who are you?”. Authorisation must also answer “is this yours?” for every object, on every request.
PART 02

Why automated tools miss it

To a scanner, a request for invoice 18343 that returns 200 OK looks exactly like a correct response. Detecting BOLA requires knowing which objects belong to which user, which means testing with at least two accounts and understanding the business meaning of each field.

WHY IT MATTERSBOLA is a logic flaw, not a malformed input. Finding it needs context that only a human tester, or carefully built test data, can provide.
PART 03

How our testers find it

We map every endpoint that takes an identifier, including IDs hidden in request bodies, headers and GraphQL arguments. Then we replay each request as a second user and a lower-privileged role, and look for anything that returns, changes or deletes data the caller should not reach. Sequential IDs make this trivial; UUIDs slow attackers down but do not fix the flaw.

WHY IT MATTERSTesting as two users in two tenants is the single most effective way to surface authorisation flaws before attackers do.
PentestX in practiceFIND-0214 · /api/orders
Found · CriticalFix shippedRetested · Closed

Every fix in PentestX triggers a scoped retest, so “resolved” always means verified, with evidence attached. See how retesting works →

PART 04

How to fix it properly

Enforce ownership in one place on the server: load the object, compare its owner or tenant to the caller, and refuse the request if they do not match. Prefer framework-level policies over checks scattered through controllers, and return the same 404 for “not found” and “not yours” so IDs cannot be enumerated.

WHY IT MATTERSA single, centrally enforced policy is far harder to forget than a check every developer must remember to write.
WRAP-UP

Keep it fixed

Add authorisation tests to your test suite that call every object endpoint as the wrong user and expect a refusal. Retest after every change to access control, and include tenant isolation in every API pentest scope.

PentestX API assessments test every endpoint for BOLA and BFLA as multiple users and roles, and every confirmed finding ships with request-level proof and a retest once it is fixed.

PentestX Security Team
WRITTEN BYPentestX Security TeamThe pentesters and analysts behind PentestX. We spend most weeks breaking websites, apps, APIs and clouds, and the rest writing about how to stop that from happening.More from Alex →