Broken object level authorisation (BOLA) is number one in the OWASP API Security Top 10, and for good reason: it's common, easy to exploit and usually serious. It's the API version of the IDOR you met in the web track. Its sibling, broken function level authorisation (BFLA), is number five. Together they cover the two questions an API must ask on every request: may this user touch this object? and may this user call this function?
BOLA (API1): someone else's object
An API endpoint takes an object identifier and returns or changes that object without checking it belongs to the caller.
GET /api/v2/vehicles/7f3c1e2a-9b4d-4c1e-8f2a-1d2e3f4a5b6c/location HTTP/1.1
Authorization: Bearer <alice's token>If Alice can replace that vehicle ID with Bob's and get Bob's car location, that's BOLA. In real incidents, BOLA has exposed vehicle locations, medical records, bank statements and entire customer databases.
Why it's so common in APIs
- APIs expose object IDs directly in paths, queries and bodies.
- Developers check that the user is logged in and forget to check that the user owns the object.
- Authorisation logic is copied endpoint by endpoint, and one copy is always missing.
Where IDs hide
- Path segments:
/users/42/invoices/1001 - Query strings:
?accountId=42 - JSON bodies:
{"orderId": 1001} - Headers:
X-Tenant-Id: 7 - Nested and related objects: the
customerIdinside an order you do own - Batch endpoints:
{"ids": [1001, 1002, 1003]}
Testing BOLA systematically
Two accounts per role
Create user A and user B with the same role. Every object belongs to one of them, so you can test cross-access using only your own test data.
The method
- As user A, use every feature and record each request containing an object ID.
- Note user B's IDs for the same kinds of objects.
- Replay each of A's requests, with A's token, but B's IDs.
- Test every method: B's object might be protected for
GETbut not forPATCHorDELETE. - Test related endpoints: if
/orders/{id}is protected, check/orders/{id}/invoice,/orders/{id}/itemsand exports.
"The IDs are UUIDs"
Random identifiers make guessing impractical, but they aren't access control. UUIDs leak through other responses, shared links, emails, logs and public features like reviews or leaderboards. If you can obtain B's ID by any means and the API returns B's data, it's BOLA. Report it, and note how the ID was obtained.
Useful variations
- Different ID formats: if
/users/42is blocked, try/users/42.json,/users/0042or an array[42]. - Parameter pollution:
?id=MY_ID&id=OTHER_ID: which one does the server use for the check, and which for the lookup? - Wrapped IDs: IDs inside Base64 or JWTs can be decoded, changed and re-encoded if they aren't signed.
- "Me" endpoints:
/users/memay be safe while/users/{id}isn't.
BFLA (API5): someone else's function
BFLA is about functions, not objects: a normal user calling an endpoint meant for admins or another role.
Finding admin functions
- Documentation listing admin endpoints.
- JavaScript for the admin interface, often shipped to every user.
- Predictable patterns: if
GET /api/v2/users/42exists, tryGET /api/v2/admin/usersorDELETE /api/v2/users/42. - Different paths for the same action:
/api/v2/users/42/roleversus/api/v2/admin/users/42.
Testing
- Capture admin requests while logged in as an admin test account.
- Replay them with a normal user's token, and with no token at all.
- Try method switching: an endpoint that blocks
DELETEmay allowPOSTwith a parameter like_method=DELETEor an override header.
The Autorize Burp extension automates replaying with a low-privilege token, as in the web track.
The API authorisation matrix
Build the matrix from the web track for the API: endpoints down the side, roles and both same-role accounts across the top, with the expected result in each cell. Test every cell; each mismatch is a finding.
| Endpoint | Anonymous | User A | User B | Mechanic | Admin |
|---|---|---|---|---|---|
GET /vehicles/{A's id}/location |
401 | 200 | 403 | 403 | 200 |
PATCH /users/{A's id} |
401 | 200 | 403 | 403 | 200 |
GET /admin/users |
401 | 403 | 403 | 403 | 200 |
POST /mechanic/reports |
401 | 403 | 403 | 200 | 200 |
Proving impact responsibly
- Use your own two test accounts for cross-access whenever possible.
- If real data must be shown, retrieve one record, don't download, and redact it.
- Never modify or delete real users' data. Prove write access against your own test objects.
- For broad BOLA, explain scale: "any of the platform's users' records can be retrieved by iterating IDs", without actually iterating them.
How it gets fixed
- Check ownership on every request, in a central authorisation layer, for every method: look objects up with the caller's identity (for example, order 1001 where owner = current user).
- Take the user and tenant identity from the server-side session or token, never from client-supplied IDs.
- Deny by default for functions; map every endpoint to the roles allowed to call it.
- Add automated tests that call each endpoint as the wrong user and expect a
403or404. - Reference: OWASP API Security Top 10, API1 and API5.
Lab
In crAPI with your two accounts:
- Find an endpoint that returns vehicle information by ID. Can user A see user B's vehicle?
- Find where other users' IDs leak (hint: look at community or public features).
- Look for an endpoint that seems intended for mechanics or admins and call it as a normal user.
- Build an authorisation matrix for six crAPI endpoints and test every cell.
- Write one complete BOLA finding with reproduction steps and the ownership-check fix.
Checkpoint
- What's the difference between BOLA and BFLA?
- Why do you need two accounts with the same role?
- Name four places an object ID can appear in an API request.
- Why must the fix use the identity from the session rather than from the request?