Classification
- OWASP API Security Top 10 2023: API1 Broken Object Level Authorization.
- CWE-639: Authorization Bypass Through User-Controlled Key; also CWE-285 Improper Authorization.
- OWASP Top 10 2021: A01 Broken Access Control.
Testing BOLA at API scale
Build an object map: for each object type (user, order, document, device), list every endpoint and method that takes its ID, including nested routes, bulk endpoints that take arrays of IDs, and GraphQL fields. Authenticate as two users in the same role and, for multi-tenant APIs, as users in two tenants. Replay each call with the other user's IDs. Pay attention to write operations: BOLA on PUT or DELETE is often worse than on GET and more often missed. Bulk endpoints are a frequent source because a check is applied to the first ID only.
Proof
Proof is a differential: the attack request (user A, user B's ID) returns B's object or confirms a change; the control request (user A, a well-formed non-existent ID) returns not-found. If both return the same generic response, there is no proof. For write operations, show B's object before and after. Keep evidence to test accounts.
Remediation
- Derive ownership from the session or token, never from a client-supplied user ID.
- Apply authorisation in a shared layer for every object type, covering all methods and bulk endpoints.
- Check each ID in batch requests individually.
- Write integration tests that run each endpoint as a second user and expect 403 or 404.
- Log and alert on high rates of authorisation failures, which indicate enumeration.
How Pentest-Swarm tests for BOLA
BOLA is where Pentest-Swarm's api-security playbook concentrates, and it is proven by an external differential oracle rather than by a model's opinion.
- Recon builds an endpoint and parameter inventory from specifications, crawling and parameter discovery.
- The exploit agent replays harvested victim IDs and pairs each attack with a non-existent-ID control; only a divergent response is VERIFIED (with
--verify, currently beta). - Shipped chains on VAmPI and app profiles for crAPI demonstrate BOLA on bundled labs you can run locally.
- Proven findings carry the request pair, CVSS and a sandboxed Python proof of concept.
Where it falls short
BOLA proof needs at least two identities and real object IDs; provide test accounts for each role and tenant. Pentest-Swarm will not know that a field is confidential in your domain, and it may miss BOLA reachable only after a multi-step workflow. A manual tester remains valuable for complex permission models such as shared documents with per-user roles.
Questions
Why is BOLA the top API risk?
Because APIs expose object IDs directly and authorisation has to be implemented per endpoint, so a single missed check exposes data, and scanners with one account cannot detect it.
Is a 403 versus 404 difference a BOLA?
No. It may leak that an object exists, which is a minor information issue. BOLA requires actually returning or changing the object.
How do I test BOLA in GraphQL?
The same way: query or mutate objects by ID as a different user, including through nested fields that reach the same object from another parent.