Pillar guide · 12 min read

What is BOLA? The #1 OWASP API vulnerability explained

Published May 17, 2026 · Educational guide. Cites OWASP API Security Top 10 and the publicly reported Optus 2022 breach. No exploitation steps.

BOLA — Broken Object Level Authorization — is the most common serious vulnerability in modern web APIs. It has held the top spot of the OWASP API Security Top 10 (the API-focused sibling of the OWASP Top 10 for web applications) since the list was first published in 2019 and retained #1 in the 2023 revision. If you operate an API that returns user-specific or tenant-specific data, BOLA is the single category of bug most likely to lead to a mass data exposure incident on your watch.

This article explains what BOLA is in plain terms, why traditional vulnerability scanners miss it, the canonical real-world example (Optus 2022), how to detect it in practice, and what CyberScore does — and crucially does not — do in this category.

Definition in plain English

BOLA happens when an API endpoint identifies an object (a user, an invoice, a document) by an identifier in the request, authenticates the caller, but fails to check whether that specific caller is allowed to access that specific object. The endpoint says "sure, here is the data" to anyone who is logged in, regardless of whether the data belongs to them.

The canonical example:

GET /api/users/123/profile
Authorization: Bearer <token-for-user-456>

200 OK
{ "id": 123, "email": "alice@example.com", "ssn": "..." }

User 456 is authenticated but is requesting user 123's profile. The endpoint should return 403 Forbidden; instead it returns 200 and hands over Alice's data. That is BOLA. Replace /users/123 with /invoices/123, /documents/abc, or /api/v1/accounts/9981 — the pattern is the same.

The exploit, in the worst case, is a script that increments the identifier and dumps every object. That is exactly what happened in the highest-profile cases.

BOLA vs IDOR — same thing, different vintage

You will see both terms used interchangeably. IDOR — Insecure Direct Object Reference — is the older term, popularised by the OWASP Top 10 for web applications in 2007 and 2013. BOLA is the term OWASP adopted when it published the dedicated API Security Top 10 in 2019, recognising that the same logic class behaves differently in API contexts than in HTML web apps.

Functionally they are the same vulnerability. Both involve passing an object identifier in a request and failing to authorise the caller against that object. The fix is the same: authorise every object access, not just authenticate the caller.

Why traditional scanners miss it

Most automated web scanners look for patterns in request and response: a SQL injection payload that triggers a database error, an XSS string that gets reflected, a directory traversal that returns /etc/passwd. BOLA has no such pattern. A BOLA request looks exactly like a legitimate request — same structure, same headers, same content type. The only thing that distinguishes a malicious BOLA request from a legitimate one is the business logic: does this token own this object?

That logic lives in your application code. A scanner cannot derive it from outside. Even with authenticated scanning, the scanner needs at least two user contexts (test user A and test user B) and the knowledge of which objects belong to which user, in order to generate a BOLA test by requesting B's object with A's token. Most off-the-shelf DAST tools do not do this well.

The practical consequence is that BOLA is usually found one of three ways: a manual pentest with a skilled tester, a custom test suite written by the development team, or a breach.

Real-world example — Optus 2022

The Optus breach of September 2022 — one of the largest data exposures in Australian history — has become the canonical teaching example for BOLA. According to public reporting and statements from the company and Australian regulators, an exposed customer-facing API endpoint accepted incrementing customer identifiers, performed no proper authorisation check, and allowed an attacker to enumerate the personal data of approximately 9.8 million customers including names, dates of birth, addresses and government identification document numbers.

The technical pattern was textbook BOLA: the API authenticated (or did not require auth at all, in some accounts), accepted the identifier, did not check ownership, returned the record. Repeat in a loop, change the number, dump everything.

The lesson for engineering teams is uncomfortable: the bug was simple, single-file, findable by any developer who knew to look — and it sat in production long enough for a third party to extract a country's worth of customer records.

How to detect BOLA in practice

Detection breaks into three approaches, in descending order of confidence:

  1. Manual pentest with two users. A skilled tester creates two test accounts, identifies endpoints that take object IDs in paths or bodies, and systematically attempts to access user A's objects with user B's token. This is expensive (a senior tester, several days) but is the gold standard. Annual pentests are the right cadence for most teams.
  2. Custom integration tests in your CI pipeline. Write tests that explicitly verify cross-tenant access is rejected. Every endpoint that returns user-scoped data gets a test like user_b_token_cannot_read_user_a_invoice. Cheap once written, catches regressions.
  3. Heuristic detection from outside. Parse the OpenAPI / Swagger document or GraphQL introspection schema, identify endpoints that take ID-shaped parameters, flag those for review. This produces a list of candidate BOLA endpoints, not confirmed BOLA endpoints. Useful as a triage feed for #1 or #2; not a substitute.

The most effective programmes combine all three: heuristic detection for breadth, integration tests for regression coverage, annual manual pentest for depth on the high-value endpoints.

Preventing BOLA in code

The fix is conceptually simple and operationally stubborn: every endpoint that loads an object by ID must authorise the caller against that object before returning it.

Practical guidance:

  • Centralise authorisation in a single function or middleware rather than scattered if user.id == obj.owner_id checks in controllers. Centralised checks are testable and harder to forget.
  • Default to deny. New endpoints should refuse access unless an authorisation rule explicitly permits it.
  • Prefer opaque, hard-to-guess identifiers (UUIDv7, ULID) over sequential integers for any externally exposed ID. This does not fix BOLA but raises the effort to exploit it — sequential IDs are trivially enumerable, UUIDs are not.
  • Log object-level access. If a BOLA does slip through, access logs let you scope the impact and notify.
  • Test cross-tenant access in CI. The test is short, the protection is durable.

What CyberScore detects (and doesn't)

CyberScore approaches BOLA conservatively because we are a passive external scanner. We do not authenticate to your API, we do not send payloads, and we do not attempt to exploit anything. Within those limits, here is what we do:

  • Look for publicly exposed OpenAPI / Swagger documents (/swagger.json, /openapi.yaml, common variants) and parse the schema.
  • Probe for publicly accessible GraphQL endpoints with introspection enabled (/graphql, /api/graphql). An exposed introspection surface is already a finding in itself.
  • Identify endpoints and types that take ID-shaped parameters (path segments matching /[a-z]+/(\\d+|[a-f0-9-]{36}), query params like user_id, account_id, doc_id).
  • Flag those endpoints as BOLA candidates requiring authorisation testing.

What we do not do: try /users/1, /users/2, etc., to see if an unauthenticated request returns data. That would be active probing of customer infrastructure, which violates our passive-only stance (see security page and methodology). Our BOLA finding is a yellow flag for the engineering team to investigate, not a proof-of-concept exploit.

For full BOLA validation you need an authenticated DAST tool (Burp Suite Pro with user-context scripting, or Acunetix with two-user macros), a manual pentest, or an in-house test suite with two distinct user contexts.

Frequently asked questions

What is BOLA in API security?+

BOLA stands for Broken Object Level Authorization. It is a vulnerability where an API endpoint accepts an object identifier (typically a user ID, account ID, or document ID) in the request, but fails to verify that the authenticated caller is actually authorised to access that specific object. It is ranked #1 on the OWASP API Security Top 10 and is the single most common cause of mass data exposure via APIs.

What is the difference between BOLA and IDOR?+

Functionally they are the same vulnerability — accessing an object you should not be allowed to access by manipulating its identifier. IDOR (Insecure Direct Object Reference) is the older OWASP Top 10 web-app term; BOLA is the newer term coined by OWASP for the API Security Top 10. Many people use them interchangeably. The technical fix is identical: authorise every object access, not just authenticate the caller.

Why do traditional vulnerability scanners miss BOLA?+

Because BOLA is a logic flaw, not a payload-driven vulnerability. There is no malicious string to detect; the request itself looks identical to a legitimate one. Detecting BOLA requires understanding the application context — what objects exist, who is supposed to access which, and what should happen when an unauthorised user tries. That context is invisible to a passive scanner and difficult to derive automatically.

How was BOLA involved in the Optus breach?+

The publicly reported Optus 2022 breach involved an exposed customer-facing API endpoint that accepted incrementing customer identifiers without proper authorization checks, allowing an attacker to enumerate roughly 9.8 million customer records. This is a textbook BOLA — the endpoint authenticated but did not authorise per-object access. The Optus case is now a standard teaching example for API security training.

Can CyberScore actually find BOLA in my API?+

Heuristically, yes — we parse OpenAPI / Swagger documents and GraphQL introspection responses to identify endpoints that take object identifiers in paths or query parameters and flag the patterns most associated with BOLA risk. We do not actively exploit endpoints. True BOLA detection requires authenticated testing with multiple user contexts, which is the territory of a manual pentest or a DAST tool with proper auth scripting. Our role is the early-warning signal, not the proof-of-exploitation.

See whether your APIs expose BOLA candidates

Run a free CyberScore sample scan. We'll look for exposed Swagger / OpenAPI / GraphQL surfaces and flag the endpoints whose URL shape is most associated with BOLA risk. It is the cheapest first-pass triage before an authenticated pentest.

Found a factual error or want to suggest another breach example? Email patrick@cybersco.re.