ACC-38Required
Apply removed roles within the revocation limit
Apply a removed role or permission within the limit in end sessions when access changes. Never keep roles only inside a long-lived token or cache.
How to do it
Load the membership on each request, or cache it for no longer than that limit and clear the cache on every change. If access tokens carry roles, compare a membership version on each request, because a token may live longer under verify every token. Removing someone from an organisation follows remove access when someone leaves. It works when you check a named permission on the server for every action.
How to check
Demote a signed-in test admin to viewer. Within 60 seconds, their next admin request answers 403.
Sources
- OWASP ASVS 5.0 V8 Authorization on applying changes immediately
- OWASP Authorization Cheat Sheet on checking every request
Related rules
- ACC-29 End sessions when access changes in Accounts and identity
- APS-12 Verify every token in Application security
- ACC-46 Remove access when someone leaves in Accounts and identity
- ACC-34 Check a named permission on the server for every action in Accounts and identity
- APP-69 Check every incoming change against the sender's rights in Web app interface
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/accounts/roles-and-permissions/role-changes-immediate">Agent Wranglers accounts and identity playbook</a>. In code you write, add a comment next to it with the same link.