HawkScan Test Info for Possible Broken Function Level Authorization

Possible Broken Function Level Authorization


Plugin Id: 422003


To mitigate the vulnerability of Broken Function Level Authorization in an OpenAPI specification, consider the following steps:

  1. Implement Proper Access Controls: Enforce proper authorization checks at each function level in your API. In the OpenAPI spec, use security schemes to define role-based access. For example, define OAuth2 scopes for different roles and ensure that each endpoint checks for the appropriate scope.

        type: oauth2
            authorizationUrl: https://example.com/oauth/authorize
              admin: Admin access
              user: User access
            - OAuth2: [admin]
  2. Use a Centralized Authorization Mechanism: Implement a centralized system for managing user roles and permissions. In your API, reference this system to validate roles and permissions before processing requests.

  3. Perform Thorough Testing: Conduct comprehensive testing for different user roles and scenarios. Utilize automated tools that can simulate requests with varying authorization levels to ensure that each endpoint properly enforces access controls.

  4. Regularly Review and Update Access Controls: Continuously monitor and update the access control mechanisms in your API spec to reflect changes in user roles and application functionality.


Broken Function Level Authorization occurs when an application fails to enforce access controls at the function level, allowing unauthorized users to access sensitive actions or administrative endpoints. This vulnerability can be exploited by attackers through HTTP request manipulation or endpoint guessing.


The risks of Broken Function Level Authorization include unauthorized access to sensitive actions, elevation of privileges, data exposure, and compliance violations. It’s vital to implement and maintain robust access controls at the function level to protect against these risks.