Find Broken Access Control and Enforce Checks on the Server
Broken access control occurs when a user requests data or functionality they are not permitted to use and the server fails to stop them. Checking only whether someone is signed in is not enough. For every request, the server must verify who is asking, which resource is involved, and which action is requested; if permission cannot be established, it should deny the request.
Why can a problem occur after authentication succeeds?
Authentication establishes who is making a request. Authorization decides whether that person may perform a particular action on a particular resource. A signed-in customer may still have no right to read another customer's order or invoke an administrative function. Missing or incorrect checks can disclose information, change or delete data, or elevate privileges. MITRE distinguishes a missing authorization check (CWE-862) from an authorization check that is present but incorrect (CWE-863).
OWASP Top 10:2025 A01 covers broken access control. OWASP gives examples such as changing URLs or request values, using another user's identifier, directly calling an administrator route, and omitting checks for API write operations. This article focuses on a practical review of user, role, resource, and action boundaries in web applications and APIs. It does not attempt to explain every related topic, such as SSRF or path traversal.
Which boundaries should you check?
Access control involves more than asking, “Is this user signed in?” The decision may depend on the subject (a user or service), resource (an order, file, or account), action (read, edit, delete, or approve), and business conditions (ownership, organization, or state). These are common test dimensions:
| Dimension | Example failure | Question to check |
|---|---|---|
| Horizontal boundary | Customer A reads customer B's order despite having the same role | Is the requested resource within the current user's ownership or organization scope? |
| Vertical boundary | A regular user calls an administrator API | Does the server check the role or permission required for this action? |
| Action boundary | Read is allowed, but delete or refund is allowed unintentionally | Are read, create, update, delete, and approval treated as distinct actions? |
| Field boundary | A profile update includes role or ownerId and changes authority | Does the server accept only an allowlist of fields the user may edit? |
| State or organization boundary | A user retains access to a closed project or another tenant's record | Are current state and organization relationships rechecked on each request? |
Role-based access control (RBAC) can assign baseline capabilities to roles, but it does not automatically enforce ownership boundaries between users with the same role. Relationship or attribute conditions, such as resource owner or organization, must also match the business rules. A database account may be allowed to access a table while application policy still determines which person may see each row.
How should server checks be designed?
Suppose customer A is signed in to an order service and requests /orders/731. Hiding the order number in the interface or using a long, unpredictable identifier does not grant authorization. A requester can change an identifier with browser tools or an HTTP client, so the server must verify the relationship between the current user and the order.
A conceptually safer lookup asks for “the order numbered 731 that belongs to the current user,” rather than merely “the row numbered 731.” Apply the same scope to updates and deletes. If ownership is checked in one code path and the change happens later in another, the state may change between the check and use. Where possible, include the authorization scope in the data operation and check business conditions within a transaction. This is an illustrative design pattern, not a guarantee about any particular framework.
Protect administrative functions with server-side centralized authorization policies, and review each HTTP method and sub-action in an API separately. Hiding a button or omitting a route from a menu controls the user experience; it does not replace server authorization. Start with deny by default and explicitly mark public access. When an authorization check fails, stop the operation and verify that it does not leave partially applied changes.
How can you verify controls in an authorized environment?
This procedure assumes a development or staging environment that you own or are explicitly authorized to test. Do not access other users' data in a production system without permission. Prepare two test accounts (A and B), test resources for each, an administrator account, and the normal requests for each account. Avoid real personal information in test data and accounts.
List resources and actions. For example, distinguish reading, canceling, and refunding an order; reading and editing a profile; and downloading an administrator report.
Define which subjects and conditions are allowed for each combination. Record ownership, tenant, resource state, and editable fields as well as roles.
Write both allowed and denied cases. For example, A may read A's order, while reading or editing B's order must be denied.
Send a normal request as account A and record the response and identifier. Then use account B's session to request the same path and method. Change identifiers in the resource ID, path, query, body, and hidden fields.
Test creation, editing, deletion, export, approval, and each API method, not just reads. Try an administrator-only action as a regular user and inspect each field on editable objects.
Check the response code, response body, persisted state, side effects, and logs. A denial response is still a failure if the change already occurred.
After fixing a defect, keep the same cases as regression tests. Check that expected permissions still apply after roles, organizations, or ownership relationships change.
| Case | Expected result | Also verify |
|---|---|---|
| A reads A's order | Allowed | Order contents match the test data |
| B reads or edits A's order | Denied or concealed according to policy | Neither the response nor persisted state changes |
| A regular user runs an administrative action | Denied | Direct API calls also fail when the UI is bypassed |
A user adds role or ownerId to a request body | Only allowed fields are applied, or the request is rejected | Stored role and ownership remain unchanged |
| A permission condition is missing or an attribute lookup fails | Denied by default | Failure does not turn into permission |
A product may use the same response for a nonexistent resource and one the requester cannot access. That can reduce information about whether a resource exists, but it does not mean the same status code is right for every system. Define consistent error handling for business needs, and confirm that access is blocked regardless of the response.
What should be reviewed repeatedly and in production?
Authorization is not a one-time setting. Check that new API routes, asynchronous jobs, file downloads, batch processing, and mobile and web clients follow the same server-side rules. OWASP recommends applying authorization on every request, denying by default, using least privilege and reusable policies, and writing unit and integration tests. Framework middleware or a policy engine can help prevent omissions, but do not assume that it automatically understands resource ownership and business conditions; review its configuration and boundaries.
For denied events, record information needed for investigation, such as user identifier, target resource, action, policy result, and request correlation ID. Do not record tokens or entire sensitive request bodies. Repeated failures can be a detection signal, but a failure count alone does not prove an attack. Restrict log access and retention as well.
The core fix is not to hide identifiers; it is for the server to validate the subject, resource, action, and business conditions together on every request. Automate allowed and denied tests with owner and administrator accounts, then repeat them when policies change or endpoints are added to find gaps early.
References
[OWASP Top 10:2025 A01 Broken Access Control](https://top10.owasp.org/2025/A01_2025-Broken_Access_Control/)
[OWASP Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html)
[MITRE CWE-862: Missing Authorization](https://cwe.mitre.org/data/definitions/862.html)
[MITRE CWE-863: Incorrect Authorization](https://cwe.mitre.org/data/definitions/863.html)
[OWASP Web Security Testing Guide v4.2: Authorization Testing](https://owasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/05-Authorization_Testing/)