Web application security
Testing IDOR and broken access control
Broken access control is the most common serious finding in web assessments. The test is systematic; the fix usually is not.
The shape of the bug
An IDOR exists whenever a request carries a reference to an object and the server retrieves that object without confirming the caller is entitled to it. The classic form is a numeric identifier in a path: /api/orders/1042. The subtle form is a UUID, a slug, an email address, or a composite key — a different-looking identifier with exactly the same problem.
The reason it survives review is that it is invisible in the code path a developer looks at. The route handler looks fine: it parses the identifier, it loads the record, it serialises it. The missing check is the one that compares the record's owner to the authenticated principal — and often that check does not exist anywhere.
A repeatable test method
We do not guess identifiers. We build an inventory of every request that carries a client-controlled reference and note what each one returns. Then we replay the requests with a second identity, of a different role where one exists.
The comparison is mechanical: same request, different identity, same object. If account 88 can read account 12's order, the response differs from what account 88 is entitled to see, and that difference is the finding.
We test in both directions. Horizontal escalation is one user reading another's data. Vertical escalation is a low-privilege user reaching an administrative function — often the same endpoint with a different role, or the same request with a parameter that names a user id instead of an order id.
- Enumerate every parameter that references a resource: path, query, body, and headers
- Map each one to the object it resolves to and the check that should exist
- Replay with a second identity at the same privilege level
- Replay with a lower-privilege identity to test vertical escalation
- Test the administrative variants of the same endpoints
Why it keeps coming back
Three failure patterns account for most repeats. The check exists in one place and the application has three other paths to the same data. The check exists but compares the wrong field — the account that created the record rather than the account entitled to read it. Or the check is in the interface, not the service, so anything that talks to the service directly bypasses it.
There is also the multi-tenant version of the same bug: the tenant identifier is taken from the session on one code path and from a header on another. A tenant boundary that is only enforced in one place is not a boundary.
Closing it for good
The durable fix moves authorisation into the data access layer, where every caller goes through it. A repository method that takes an owner or tenant argument and refuses to load records outside it makes the check structural, rather than something each new endpoint has to remember.
Two habits make it stick. First, treat a missing authorisation check as a design defect rather than a bug — it usually means the model has no place to express ownership. Second, add an automated test per endpoint that asserts a second identity gets a 403 or a 404; the bug survives exactly as long as nobody wrote that test.
What to report
An access-control finding should state which identity reached which object, what the response contained, and what the correct response would have been. If the endpoint returned a full object, note what fields in it were sensitive — a leaked email address is a different severity from a leaked address, payment reference and signature.
Then record the object identifier and the two identities. That is what makes the retest possible: the same two accounts, the same object, after the fix.