liveBook · Manning

Broken function-level authorization

As explained in Secure APIs

Broken function-level authorization is a vulnerability in which an API fails to enforce authorization for a function or operation, allowing users without the required permissions to invoke it.

Broken function-level authorization (BFLA) occurs when an API lets a user invoke an operation outside that user’s role. A normal user reaching an admin endpoint is performing vertical privilege escalation; accessing another user’s data is the separate problem of BOLA. section 4.7

An unprotected admin endpoint

An endpoint such as GET /admin is vulnerable when it returns success without checking the caller’s role. To mitigate it, validate the access token, read its permissions claim, and allow the operation only when it contains admin. Return 403 when credentials are valid but insufficient; use 404 instead when concealing a sensitive endpoint is preferable. section 4.8

Apply these checks to reduce BFLA risk:

  • Declare roles or permissions explicitly in access tokens. section 4.11
  • Evaluate the caller’s permissions for every requested operation, including admin and developer APIs hidden behind subdomains or URL paths. section 4.7
  • Test endpoints as users with different roles, rather than treating undisclosed paths as protected. section 4.7
Figure 4.15 A good strategy to prevent BFLA is to declare user roles explicitly in access tokens and check those roles on every request across all operations.
figure

Use the role-check flow as a mental model: declare roles in access tokens, then check them on every operation. section 4.7

How Secure APIs covers it

How deep it goes
Defines privilege escalation, contrasts BOLA, and demonstrates token validation with permission checks and HTTP responses.
Examples
Uses normal, admin, and developer roles; a GET /admin endpoint; permissions claims; and 403 or 404 responses.
What it assumes
Assumes familiarity with API requests and access tokens while introducing roles, RBAC, and privilege escalation.
What you can do after
Diagnose unauthorized function access and implement per-operation role checks using validated access-token claims.
How it connects
Connects BFLA with RBAC, privilege escalation, BOLA, access tokens, and API authentication.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.