What the weakness looks like

An API can identify a record with a number, a name or a long random value. The format does not decide who may read or change that record. The server must check that the signed-in user has permission for the exact object in each request.

A weakness occurs when the application checks that a user is signed in but does not check that the user may access the requested account, order, document or project. This can expose or change another customer’s data.

Test the rule with different accounts

Create two test users with separate records. Sign in as the first user and request the second user’s record through each relevant route. Check read, update and delete actions. Use only test data and systems that are in the approved scope.

Repeat the check for nested records and indirect routes. A page may hide a button while the API still accepts the request. Also test whether support, manager and administrator roles have the intended limits.

Enforce authorization on the server

Apply an object-level permission check on every request that reads or changes a record. Use the authenticated identity and the record relationship to make the decision. Do not rely on a value supplied by the browser as proof of ownership.

Add automated tests for users who should be denied access. Review the check when a new route or role is added. An API penetration test can help validate the rules across the application’s key user flows.