Course contentsShow
← Security
Lesson 992 of 3,05221. Web Security - API SecurityFree lesson

Broken Function Level Authorization

Test privilege boundaries by accessing admin endpoints, elevated functions, and role-restricted operations as lower-privileged users.

Broken Function Level Authorization

What you'll learn: How attackers escalate privileges by calling admin or role-restricted functions they shouldn't have access to.

What Is Broken Function Level Authorization?

Broken Function Level Authorization occurs when an API fails to properly verify whether a user has the correct role or permissions to access certain functions or endpoints. While Broken Object Level Authorization (the previous lesson) deals with accessing specific data objects, this vulnerability is about accessing administrative or privileged functions themselves.

Think of it like a hotel: Broken Object Level Authorization is when a guest accesses another guest's room. Broken Function Level Authorization is when a guest walks into the staff-only area and starts using management systems.

How the Attack Works

APIs often expose different endpoints for different user roles:

  • /api/users/profile - regular users
  • /api/admin/users/delete - administrators only
  • /api/manager/reports - managers only

The vulnerability exists when the API:

  1. Doesn't check if the caller has the required role before executing
  2. Relies only on hiding endpoints from the UI (security through obscurity)
  3. Uses predictable endpoint naming that attackers can guess

An attacker with a regular user account might discover admin endpoints through:

  • API documentation left exposed
  • Predictable URL patterns (/api/user/update → /api/admin/user/delete)
  • Leaked API specifications
  • Observing network traffic

They then simply call these elevated functions directly, bypassing any UI-level restrictions.

Testing for This Vulnerability

Test by attempting to access admin endpoints, role-restricted operations, and elevated functions using credentials from lower-privileged accounts. Try changing HTTP methods (GET to DELETE), modifying URL paths to admin versions, and calling functions that should require higher permissions.

Key Takeaway: Always verify the caller's role and permissions server-side before executing any privileged function—never trust that users will only access endpoints shown in the UI.