SecLab
Access ControlwalkthroughDifficulty 3/525 min

Function-level authorisation (API5)

Objective: After this lesson you know which endpoints in your system nobody authorises — and why counting by eye is not enough.

V8API5:2023A01:2025api-security
Step 1 of 5 · read5 min

The endpoint your UI never shows

BOLA (API1) is "may you read this record". BFLA (API5) is "may you call this function" — and it is the easier one to miss, because it usually lives at an endpoint the UI never calls.

The typical mechanism, and it recurs in every product:

  1. There is a DELETE /api/users/{id} for the admin screen.
  2. The UI only shows the Delete button to admins. Product-wise, that is the job done.
  3. Nobody tests that endpoint, because "nobody can reach it".
  4. Production Swagger lists it, schema included.

The point worth saying plainly: a UI is not a security control. It is a hint about intent. Hiding a button does not stop a request; it only stops a user sending that request by accident.

Three common variants, ordered by how often I find them in real code:

VariantWhat it looks likeWhy it passes review
The "internal" endpoint/api/internal/reindex, no attribute at allThe word "internal" in a path feels like protection
A new method on an old controllerClass carries [Authorize(Roles="Admin")], a new action adds [AllowAnonymous] for testing and it never comes offThe diff is one line, and it is the last line
The HTTP method nobody thought aboutGET /api/reports/{id} is authorised, DELETE on the same route is notReviews read by route, not by route × method pair

Why counting by eye is not enough: a mid-sized API has 200–400 route × method pairs. A human reading them all once misses some, and re-reading them every sprint is something nobody does. The only durable answer is deny by default — see the fix step.

View path

Comments

Join the discussion
Sign up to comment

Commenting needs an account with at least one completed lesson. That condition is what keeps this thread worth reading: every point belongs to someone who can be asked back, and reputation accrues over time.

Sign upSign in

You can still read every comment below without an account. Signing in brings you back to this exact spot, not to the top of the page.

Loading comments…