SecurityBOLAIDORinsecure direct object reference

Broken object-level authorization

Definition

BOLA (OWASP API Security Top 10, API1:2023) is the absence of a per-object authorization check, so any authenticated caller can read or modify another user's object by changing its id.

In practice

Every id in a path, query or body is attacker-controlled, and attackers need only a normal account and a script that counts. Gateways cannot catch it because ownership needs business data. The service that loads the object must check it against the caller (owner, tenant, team) and answer 403 or 404.

Make the check structural rather than something each handler must remember: repository methods that always filter by tenant, or row-level security in the database. Random UUIDs make ids harder to guess but are not authorization; ids leak through URLs, logs and shared links.

Example

User 1001 calls GET /api/orders/58213 and receives someone else's order because the handler runs SELECT * FROM orders WHERE id = $1 without AND customer_id = $2.