Join our Newsletter — 33% off our NHI Course
Home› Guides› OWASP API Top 10 API5 Broken Function Level…
Guide Web & API Security

OWASP API Top 10 API5 Broken Function Level Authorization Guide: Protecting Admin Functions

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 26 October 2026 15 min read
On this page

Broken Function Level Authorization (BFLA) happens when an API lets a caller invoke an operation, such as an admin action, an export or a delete, without checking that the caller's role or permissions allow that operation. OWASP ranks it API5 in the API Security Top 10 2023 and rates its technical impact as severe, because administrative functions are the prime target and APIs make them easy to guess. This guide goes deeper than the summary in the Top 10 API Security Risks: it covers what the OWASP entry requires, how to design function-level enforcement that cannot be skipped, how service accounts and AI agents change the picture, and how to test, evidence and monitor the control. It is written for API developers, architects, application security engineers and testers.

Key takeaways

  • BFLA is a vertical check on the operation. The question is whether this caller may perform this function at all, for example create an admin invite or export every user, before any question about which object it touches.
  • The URL does not tell you what is privileged. OWASP warns that admin endpoints often sit beside regular ones, such as under /api/users, so classify functions by what they do, not by path.
  • The HTTP method is part of the function. If GET is allowed, PUT, PATCH and DELETE on the same route need their own decision; OWASP lists method switching as a core test.
  • Deny by default from one enforcement point. OWASP asks for a consistent, easy-to-analyse authorisation module invoked from all business functions, with explicit grants per role for every function.
  • Machine identities need function scopes too. A service account or AI agent token that can call every operation turns any compromise or prompt manipulation into admin access.

What it is and who it applies to

OWASP describes BFLA as an attacker sending legitimate API calls to an endpoint they should not have access to, either as an anonymous caller or a regular, non-privileged user. It explains that the checks are hard to get right because modern applications have many roles, groups and hierarchies (sub-users, users with more than one role), and that APIs make these flaws easier to find because their structure is predictable.

OWASP factorAPI5:2023 ratingWhat it means in practice
ExploitabilityEasyGuessing an admin route or swapping the method from the mobile app's traffic is enough
PrevalenceCommonRole logic is spread across configuration and code, so some functions are missed
DetectabilityEasyReplaying admin calls with a low-privilege token finds most cases
Technical impactSevereData disclosure, loss or corruption and, in the end, service disruption

How it differs from API1 and API3: with BOLA (API1) the caller may use the function but reaches another user's object; with BFLA the caller should never reach the function. Property-level flaws (API3) concern individual fields within an object the caller may otherwise use. See the OWASP API Top 10 API1 Broken Object Level Authorization Guide and the OWASP API Top 10 API3 Broken Object Property Level Authorization Guide. Many real incidents chain them: a missing function check on an export endpoint is also a mass object exposure.

Who it applies to: any API with more than one privilege level, which in practice is nearly all of them: customer and admin roles, tenant administrators, support staff, partner integrations and internal operations tooling. OWASP maps the risk to CWE-285 (Improper Authorization), and it is the API successor to "A7: Missing Function Level Access Control" in the OWASP Top 10 2013. The wider web equivalent is covered in the Broken Access Control Prevention Guide.

Structure and key requirements

The OWASP entry gives three diagnostic questions and four prevention requirements. Read with ASVS 5.0 and the OWASP Authorization and REST Security cheat sheets, they become the requirements below.

OWASP requirementEngineering interpretationASVS 5.0 anchor
A consistent, easy-to-analyse authorisation module invoked from all business functionsOne enforcement mechanism (middleware, policy engine or base controller) that every route passes through; no hand-written checks scattered across handlersV8.3.1 (enforced at a trusted service layer)
Deny all access by default, with explicit grants to specific roles for every functionA route with no declared permission is rejected at startup or at request time, never silently publicV8.2.1 (function-level access only with explicit permissions)
Review endpoints against business logic and group hierarchyA documented permission matrix of roles and groups against operations, including method, kept with the codeV8.1.1 (documented function-level and data-specific rules)
Admin controllers inherit from an admin abstract controller; admin functions in regular controllers check rolePrivileged operations carry an explicit permission annotation, enforced by the framework, wherever they liveV8.2.1

The three OWASP test questions, applied

  • Can a regular user reach administrative endpoints? OWASP Scenario 2 is a GET /api/admin/v1/users/all route with no function check, found by an educated guess from the API's structure.
  • Can changing the method grant a forbidden action? A user allowed to GET a resource should not be able to DELETE it by changing the verb. The REST Security Cheat Sheet recommends an allowlist of methods per route, 405 Method Not Allowed for anything else, and an authorisation check for the method on each collection, action and record. It also warns that verb tampering has bypassed access controls in some frameworks. Method override headers that let a POST act as a DELETE must go through the same check, or be disabled.
  • Can group X reach group Y's function by guessing? OWASP's example is /api/v1/users/export_all. Bulk, export, import, impersonation and configuration operations are the usual targets.

OWASP Scenario 1 shows how small the gap can be: an invite-only app calls GET /api/invites/{invite_guid}; the attacker changes this to POST /api/invites/new, an endpoint meant only for the admin console, sets the role to admin, and uses the invite to create an administrator account. The endpoint existed and worked; it simply never checked who called it.

Designing the permission model

  • Name permissions after operations: invites:create, users:export, billing:refund, mapped to roles in one place. This avoids role checks such as if role == "admin" that break when roles multiply.
  • Handle hierarchy explicitly: sub-users, delegated tenant admins and users with several roles are where OWASP says checks go wrong. Write down whether a tenant admin may perform platform admin functions (normally never) and test it.
  • Prefer attributes where roles explode: the OWASP Authorization Cheat Sheet recommends ABAC or ReBAC over pure RBAC for finer-grained and multi-tenant decisions and notes the problem of role explosion. See the Authorisation Models Guide.
  • Apply changes immediately: ASVS V8.3.2 (L3) asks that a revoked role takes effect at once, or that mitigating controls exist where decisions rely on claims cached in self-contained tokens.

Identity and NHI requirements

Function-level authorisation is often reviewed only for human roles, while the most powerful callers are service accounts, integration clients and automation. These need the same explicit, least-privilege permissions.

CallerTypical BFLA failureControl
OAuth client or partner integrationClient is granted every scope "to be safe", or the API ignores scopes once the token is validAssign only required scopes (ASVS V10.4.11) and enforce scope per operation in the resource server (V10.3.2). See the Machine-to-Machine OAuth (Client Credentials) Guide.
Internal service accountBack-end admin endpoints accept any caller from inside the clusterAuthenticate each service (ASVS V13.2.1) and authorise it per operation; separate admin APIs by host or audience
Support and operations toolingSupport role has platform-wide admin functions for convenienceNarrow support permissions, time-bound elevation, logged reason codes. See the Privileged Session Management Guide.
AI agent with API toolsAgent runs on a broad service token, so a manipulated prompt can call delete or admin functionsExpose only the tools the task needs, act with the user's delegated permissions, enforce the check in the API rather than in the prompt. See the AI Agent Authorisation Guide.
Plugin or extension routesA helper or test route is registered with a permission check that always allowsTreat every registered route as a function needing an explicit permission, including diagnostics and test data
  • Scopes are function permissions: an OAuth scope such as users:export is a function-level grant. It only protects anything if the API checks it on every request. See the OWASP NHI Top 10 NHI5 Overprivileged NHI Guide.
  • Admin interfaces need more than a role: ASVS V8.4.2 (L3) asks for multiple layers on administrative interfaces, including continuous identity verification, device posture and contextual risk, so that network location is never the only factor.
  • Default and shared admin credentials defeat the model: ASVS V6.3.2 requires default accounts to be absent or disabled; a working function check is worthless if the admin token is shared or default.

Implementation steps

  1. Build the function inventory. Export every route and method from the OpenAPI or GraphQL schema and from the framework's router at runtime, then reconcile with gateway traffic. Mark each operation as public, authenticated, privileged or administrative based on what it does. See the OWASP API Top 10 API9 Improper Inventory Management Guide.
  2. Write the permission matrix. Roles and machine clients as rows, operations (route plus method) as columns, expected allow or deny in each cell. This is the ASVS V8.1.1 documentation and the test oracle.
  3. Enforce deny by default in the framework. Add a global middleware or filter that rejects any route without a declared permission, and make the build fail if a new route has none. Use admin base controllers or annotations for privileged functions, as OWASP suggests.
  4. Externalise complex decisions. Where many services share roles, call a policy decision point with subject, action and resource and fail closed if it is unavailable. See the Policy-as-Code for Authorisation Guide.
  5. Separate administrative surfaces. Serve admin APIs on a different host, audience or gateway with stronger authentication, and never rely on the client hiding admin buttons. The gateway adds a layer but does not replace the in-service check. See the API Gateway Security Guide.
  6. Lock down methods. Allowlist methods per route, return 405 for the rest, and route method override headers through the same authorisation decision or disable them.
  7. Roll out in audit mode. Run the new policy alongside existing checks and log disagreements for one or two release cycles, fix false denials, then enforce service by service. Keep the previous policy version deployable so a faulty rule can be reverted quickly, and never roll back to "allow all".
  8. Automate regression tests. Generate one test per matrix cell and run it in CI for every role and machine client, failing the build on any mismatch.

Choosing an enforcement approach

ApproachBest fitTrade-offs
Framework annotations or base controllers (for example role or permission decorators)A single application or small teamSimple and visible in code; relies on every developer adding the annotation unless deny by default is enforced
Central policy engine (ABAC or ReBAC)Many services, complex roles, audit needsConsistent and testable; adds latency and a dependency that must fail closed
Gateway route and scope rulesCoarse separation of public, partner and admin surfacesFast to apply; the gateway rarely knows business roles, so use as an outer layer only
Separate admin service or deploymentHigh-impact administrative functionsRemoves admin functions from the public attack surface; more infrastructure to run

Smaller organisations usually get the most from framework-level deny by default, a permission matrix in the repository and generated tests. Larger organisations benefit from a shared policy service and a separately hosted admin plane, because they make the rules auditable across dozens of APIs.

Evidence and assessment

  • Design evidence: the function inventory with privilege classification and the permission matrix (ASVS V8.1.1).
  • Test evidence: CI results for every role, client and method against every operation. The OWASP Authorization Testing Automation Cheat Sheet describes a matrix file of roles and services with the expected allowed or denied response codes, driving one integration test per role.
  • Manual testing: authorised testers replay admin traffic captured from the admin console with low-privilege and machine tokens, switch methods, try method override headers and guess sibling routes. See the API Penetration Testing Guide.
  • Static checks: rules that flag routes without a permission annotation and handlers that compare role strings directly.

Detection signals and metrics

Signal or metricWhy it mattersSource
Calls to administrative operations by non-admin identities, allowed or deniedAllowed calls are live BFLA; denied bursts are probingAuthorisation decision logs
403 and 405 responses per identity, broken down by methodMethod switching and route guessing produce distinctive denial patternsGateway logs
Routes with no declared permissionShould be zero; each one is a potential BFLABuild-time route scan
Percentage of permission matrix cells covered by automated testsShows whether the control is evidenced, target 100% for privileged operationsCI reports
Machine clients holding admin scopes or rolesTracks over-privileged non-human identitiesAuthorisation server and NHI inventory
Use of privileged functions logged with subject and reasonRequired for investigation and NIST AC-6(9)Application audit logs

See the Secure Error Handling and Logging Guide for log content that supports these signals without leaking data.

Mapping to other frameworks

FrameworkReferenceRelevance to API5
OWASP ASVS 5.0V8.1.1, V8.2.1, V8.3.1, V8.3.2, V8.4.2, V10.3.2, V10.4.11Documented rules, explicit function permissions, server-side enforcement, immediate changes, admin interface layers, scope enforcement
MITRE CWECWE-285Improper Authorization
MITRE CAPECCAPEC-1, CAPEC-87, CAPEC-122Functionality not constrained by ACLs; forceful browsing; privilege abuse
NIST SP 800-53 Rev 5AC-3, AC-6, AC-6(9), AC-6(10), SA-11, AU-12Access enforcement; least privilege; log use of privileged functions; prohibit non-privileged users from executing privileged functions; developer testing; audit records
NIST CSF 2.0PR.AA-05, PR.PS-06, DE.CM-09Least-privilege permissions; secure development; monitoring
MITRE ATT&CK v20T1190, T1068, T1098Exploit public-facing application; exploitation for privilege escalation; account manipulation such as self-granted admin roles
ISO/IEC 27001:2022 Annex A5.15, 8.2, 8.26, 8.28Access control, privileged access rights, application security requirements, secure coding
CIS Controls v8.1Control 5, Control 6, Control 16Account management; access control management; application software security

NIST AC-6(10) is the closest single control statement of API5: non-privileged users must not be able to execute privileged functions. For the wider verification standard, see the OWASP ASVS Guide.

Common pitfalls

  • A permission check that always says yes: in the Gravity SMTP CVE-2026-4020 case, a REST route intended for test data had a permission callback that unconditionally returned true, so anyone could call it and receive a system report containing configured API keys and tokens. Wordfence reported more than 17 million blocked exploit attempts.
  • Hiding admin functions in the client: removing a button from the mobile app or SPA does nothing when the endpoint still answers, as OWASP's invite scenario shows.
  • Checking GET but not the other methods: read access is checked, while PUT, DELETE or a method override header on the same route reaches the write path unchecked.
  • Classifying by path: protecting /admin/* at the gateway while admin operations also live under /api/users or in GraphQL mutations.
  • Trusting internal callers: back-office APIs reachable from the cluster with no authorisation, so one compromised workload has admin functions.
  • Over-scoped machine tokens: integration and agent credentials given admin scopes because the right ones were hard to work out, and never reviewed.

Practitioner checklist

  • Inventory every route and method, and classify each operation by privilege based on what it does.
  • Maintain a permission matrix of roles and machine clients against operations, stored with the code.
  • Enforce deny by default in the framework so routes without a declared permission are rejected.
  • Implement admin functions through base controllers, annotations or a policy engine, never ad hoc role string checks.
  • Allowlist HTTP methods per route, return 405 otherwise, and authorise method override headers or disable them.
  • Serve administrative APIs on a separate surface with stronger authentication, while keeping in-service checks.
  • Grant machine clients and AI agents only the scopes they need and enforce scopes per operation.
  • Generate CI tests from the permission matrix for every role, client and method, failing the build on mismatch.
  • Log privileged function use and alert on non-admin identities calling admin operations.
  • Review admin scopes and roles held by non-human identities at least quarterly.

Standards and references

Related NHI Mgmt Group resources: Top 10 API Security Risks · API Security Guide · Broken Access Control Prevention Guide · Authorisation Models Guide · OWASP API Top 10 API2 Broken Authentication Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 26 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.