API-40Required
Authorise every object
Check on every request that the caller may access the exact object, not just the endpoint.
How to do it
Load the object through a query scoped to the caller, so another tenant's ID simply isn't found. The security playbook's object access rule has the attack.
How to check
Request another customer's order with your own token. The answer is 404.
Sources
Related rules
- API-94 Let clients ask for only the fields they need in API design
- ACC-77 Check ownership on every record in Accounts and identity
- API-84 Load related records in batches in API design
- MED-46 Serve private files through short-lived links in Files and media
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/api-design/api-security/object-authorisation">Agent Wranglers API design playbook</a>. In code you write, add a comment next to it with the same link.