Broken Object Level Authorization (BOLA)—often referred to alongside Insecure Direct Object References (IDOR)—remains the #1 vulnerability in the OWASP API Security Top 10. It happens when an application authenticates a user's session token correctly, but fails to verify that the authenticated identity is authorized to read, modify, or delete the specific object ID passed in the URL path, query string, JSON body, or GraphQL variables.
Why single-account DAST scanners miss BOLA and IDOR
A vulnerability scanner running unauthenticated—or authenticated as only a single user—cannot reliably distinguish a valid object lookup from an unauthorized cross-tenant data leak. If User A requests `GET /api/v1/orders/9481` and receives HTTP 200 with an order payload, a single-session scanner has no way to know whether order 9481 belongs to User A or to another customer. Proving BOLA deterministically requires at least two separate test accounts (Account A and Account B) in distinct user or tenant scopes.
| API Surface | Baseline Control (Account B) | Cross-Account Probe (Account A Token) | Pass vs Fail Evidence |
|---|---|---|---|
| Direct REST read (GET /api/invoices/{id}) | Account B fetches its own invoice ID and receives HTTP 200. | Replay the exact GET request for Account B's invoice ID using Account A's session token. | Pass: HTTP 403/404 with no data. Fail: HTTP 200 returning Account B's invoice fields. |
| State-changing write (PATCH / PUT / DELETE) | Account B updates a harmless profile or project field on its own record. | Send PATCH/DELETE targeting Account B's object ID with Account A's session. | Pass: Rejected with no state change. Fail: Account B's record is modified or deleted. |
| Filtered collection / export (?orgId= or POST /export) | Account B lists or exports records scoped to Tenant B. | Supply Tenant B's organization or filter ID inside Account A's list or export request. | Pass: Server ignores or rejects foreign orgId. Fail: Tenant B rows appear in response. |
| GraphQL object & nested resolver query | Account B queries `node(id: ...)` or nested `organization { billing { invoices } }`. | Execute the same GraphQL query and variables using Account A's authorization header. | Pass: Resolver enforces ownership per node. Fail: Nested object resolves foreign data. |
Step-by-step playbook for reproducing and fixing BOLA
- Provision two synthetic test accounts (User A in Tenant A, User B in Tenant B) and seed each with a recognizable marker value so cross-account leakage is unmistakable.
- Capture baseline requests as User B across read, update, export, and nested API routes to confirm the resource exists and returns expected data to its legitimate owner.
- Swap only the session cookie or Authorization bearer token to User A while keeping the object identifier from User B, then compare response status, body structure, and database state.
- Enforce object ownership in the data-access layer: scope every database query by the authenticated session's user_id and tenant_id (`WHERE id = $1 AND tenant_id = $2`) rather than relying on client-hidden UI buttons or unguessable UUIDs.
In authenticated assessment mode, you can supply two scoped test accounts to MyPentest to run paired-account access-control checks across discovered web and API routes.