Skip to main content
Be Bitwise

Broken Object-Level Authorisation

API Vulnerability Classes · API Security track

5 min read

In this module

The Most Common API Vulnerability

Broken Object Level Authorisation (BOLA) tops the OWASP API Security Top 10 for a reason: it's the API flaw most often found and exploited, and some vendor telemetry attributes around 40% of observed API attacks to it (a figure that depends heavily on whose traffic is measured). The concept is almost embarrassingly simple. An API accepts an object identifier from the client and returns the data, but never bothers to check whether the requesting user is allowed to see that specific object.

In traditional web applications the same flaw goes by another name: Insecure Direct Object Reference (IDOR). In API land we use BOLA because APIs hand out object identifiers far more directly and predictably than HTML pages ever did.

How BOLA Works

Consider an API that returns order details:

http
GET /api/v1/orders/10458 HTTP/1.1
Host: shop.example.com
Authorization: Bearer eyJhbGciOi...

That request returns the details of order 10458. If the server checks that the authenticated user actually owns this order, everything is fine. If it just hands back whatever ID was asked for, an attacker can walk the IDs and read every order in the system.

http
GET /api/v1/orders/10459 HTTP/1.1
GET /api/v1/orders/10460 HTTP/1.1
GET /api/v1/orders/10461 HTTP/1.1

Each one comes back with another customer's order, complete with names, addresses, payment details, and purchase history.

Why BOLA Is So Prevalent

BOLA is common because it is easy to introduce and hard to catch. Developers focus on ensuring an endpoint works correctly for the intended user but forget to verify that only the intended user can access the resource. Automated scanners cannot reliably detect it because they lack the business context to know which objects belong to which users.

Horizontal vs Vertical Access Control

BOLA testing splits into two flavours:

Horizontal privilege escalation: reaching objects that belong to another user at the same privilege level. User A reads User B's orders, messages, or profile data. The classic BOLA scenario.

Vertical privilege escalation: reaching objects that belong to a higher-privileged user or role. A regular user pokes at an administrator's configuration, internal reports, or management resources.

Keep the OWASP boundary in mind when you write it up. If the user calls a normal endpoint with an ID that happens to point at an admin-owned object, that's still BOLA (API1): the object-level check is missing. If the user reaches an admin-only function, such as DELETE /api/admin/users/42 or a PUT the role should never be allowed, that's Broken Function Level Authorisation (API5), and the fix is a role check on the endpoint rather than an ownership check on the object.

Testing Methodology

Step 1: Identify Object References

Catalogue every endpoint that takes an identifier in the URL path, query string, or request body:

  • Path parameters: /api/v1/users/{id}/profile
  • Query parameters: /api/v1/invoices?id=4821
  • Request body: {"document_id": "doc_9f3a"}

Step 2: Create Two Test Accounts

Register two accounts (User A and User B) and capture legitimate traffic from both. Take note of which object IDs belong to which user.

Step 3: Cross-Reference Access

With User A's authentication token in hand, try to fetch User B's objects. In Burp Suite's Repeater, take a request User A makes to their own resource, swap in an ID belonging to User B, and resend. If the server hands over User B's data, BOLA is confirmed.

The explorer below plays out Step 3. Start on Normal Request, where Alice (user 1001) fetches her own profile, then switch to BOLA / IDOR. The token hasn't changed, only the ID in the path, and the server returns Bob's record anyway. The fix panel shows the check that was missing. The other tabs cover mass assignment and the JWT none trick from earlier lessons.

A legitimate API request to view your own profile.

GET/api/v1/users/1001

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json
200 OKResponse
{
  "id": 1001,
  "name": "Alice Chen",
  "email": "alice@example.com",
  "role": "user"
}

Step 4: Test All HTTP Methods

BOLA isn't a GET-only sport. Test PUT, PATCH, and DELETE too. An API will sometimes block reads of another user's data while cheerfully allowing modifications or deletions.

http
DELETE /api/v1/users/1843/address/home HTTP/1.1
Authorization: Bearer <user_1842_token>

The UUID Misconception

There's a popular belief that swapping sequential integers for UUIDs prevents BOLA. It doesn't. UUIDs raise the bar for enumeration, but they don't stop it. Object identifiers leak everywhere:

  • API responses that list resources with their IDs
  • Referrer headers and URL logs
  • WebSocket messages and push notifications
  • Other users sharing links that contain the ID
http
GET /api/v1/documents/a8f3c2e1-9b7d-4e5f-b6a0-1c2d3e4f5a6b HTTP/1.1

If this endpoint skips authorisation checks, the UUID buys you nothing once it's been observed. Security has to come from server-side authorisation logic, not from how unguessable the identifier looks.

UUIDs Are Not Access Control

Unpredictable identifiers like UUIDs are a defence-in-depth measure, not an authorisation mechanism. They raise the bar for blind enumeration but provide zero protection once an attacker obtains a valid ID through any means.

Mitigation Strategies

Stopping BOLA in practice means putting server-side controls on every request:

  1. Push authorisation checks down to the data layer: every query should filter on the authenticated user's identity, not just the requested object ID.
  2. Use authorisation middleware: centralise access checks instead of leaving each endpoint to roll its own.
  3. Adopt policy-based access control: frameworks like Open Policy Agent (OPA) let you define authorisation rules declaratively.
  4. Log and monitor access patterns: catch enumeration attempts by alerting on unusual object-access patterns.
  5. Avoid exposing internal identifiers: keep separate external-facing identifiers mapped to internal references.

BOLA is easy to grasp, easy to exploit, and remains the most damaging API vulnerability class going. In the next lesson we'll look at injection and mass assignment, which often compound with BOLA to turn a leak into a full-blown data breach.