Skip to content
cloudgrip

$ man broken-object-level-authorization

//Attacks and vulnerabilities

What is broken object level authorization (BOLA)?

Broken object level authorization (BOLA) is an API flaw where the server uses an object ID from the request without checking that the caller may access that object. Changing the ID exposes or modifies another user's or tenant's data.

  • Attacks and vulnerabilities
  • 3 min read
  • updated Nov 11, 2026

How it works

BOLA is a missing ownership check. The server knows who the caller is, receives the ID of a record, and hands back or modifies that record without asking whether it belongs to the caller.

Almost every API call names an object. The ID may sit in the path (/shipments/88213), the query string, a JSON body, a header or a GraphQL argument. The client chooses that value, so the server has to treat it as untrusted. When a handler loads a record by ID alone, every logged-in user can reach every record just by trying other IDs.

OWASP ranks it first among API risks.

What it looks like

user_a asks for a shipment that belongs to a different account. The only thing changed from a normal request is the number at the end of the path.

output
GET /api/shipments/88214 HTTP/1.1
Host: api.acme.test
Authorization: Bearer <user_a token>
output
HTTP/1.1 200 OK
Content-Type: application/json

{"id": 88214, "account": "acct_user_b", "recipient": "B. Example", "address": "12 Sample Street"}

The account field shows the problem: a token for one account returned a record owned by another. The request is well formed and carries a valid token, so scanners and firewalls usually miss it.

The same mistake appears in several shapes:

  • Writes. The read endpoint is protected, while PUT or DELETE on the same path is not.
  • Nested objects. /accounts/7/shipments/88214 checks that you may see account 7 and never checks that the shipment is inside it.
  • Tenant IDs. Swapping a workspace or organization ID in a header or body opens a different customer's data.
  • GraphQL. One resolver that loads any object by ID exposes that type everywhere. Introspection often lists the fields that take IDs.

How to test for it

You need two accounts that should not see each other's data. This makes BOLA testing a core part of authenticated penetration testing.

  1. Set up two test users, user_a and user_b, in separate tenants if the product has them. Give each a few records of every type.
  2. List every request that carries an object ID, and note where the ID sits.
  3. Collect the IDs that belong to user_b.
  4. Replay user_a's requests with user_b's IDs. Keep the token and change only the ID.
  5. Cover every method on each path, including update, delete and actions such as export or share.
  6. Compare responses. A success status with user_b's data, or a confirmed change to user_b's record, is a finding.

Only modify records in accounts you control.

How to fix it

Make the ownership check part of the data lookup, so a record the caller may not see cannot be loaded at all.

output
# Vulnerable: the record is loaded by ID only.
shipment = Shipment.query.get(shipment_id)

# Fixed: the lookup is scoped to the caller's account.
shipment = Shipment.query.filter_by(
    id=shipment_id,
    account_id=current_user.account_id,
).first()
if shipment is None:
    abort(404)

Practices that make the fix stick:

  • Scope in the data layer. A repository method that requires an account ID, or row-level security in the database, protects routes that a developer forgot.
  • Take identity from the session. A user_id or account_id in the request is attacker input.
  • Answer 404 for records the caller may not see. A 403 confirms that the ID exists.
  • Write two-user tests. For each endpoint, assert that one user cannot fetch or change the other's record, and run the tests on every build.

Random IDs such as UUIDs make guessing harder. They are not a fix. IDs turn up in shared URLs, exported files, logs and other API responses, and the check is still missing.

BOLA, IDOR and BFLA

Insecure direct object reference (IDOR) is the older name for the same weakness, used mostly for web applications. BOLA is the name the OWASP API Security Top 10 gave it. Both map to CWE-639, and both are forms of broken access control.

Broken function level authorization is the neighbor. BOLA is about which record a user may touch. BFLA is about which operation a user may run. Reading another customer's invoice is BOLA. Calling the admin-only "delete customer" endpoint is BFLA.

See what an attacker would find.

Give us a URL and two test logins. If there’s something to find, your first exploited findings land within 24 hours.

You talk to the people who build Hydra and Cerberus. No sales script.

or write to founders@cloudgrip.ai