Context-Dependent Authorization Failures
What You'll Learn
You'll learn how authorization checks can fail when they don't account for the full context of a request, such as organizational boundaries, tenant isolation, or resource state changes.
The Core Problem
Context-dependent authorization failures occur when access control decisions ignore situational factors beyond simple user identity. While a user might have legitimate permissions in one context, those same permissions shouldn't automatically apply across different contexts like:
- Tenant boundaries in multi-tenant applications (User A from Company X accessing Company Y's data)
- Organizational units (Department manager accessing another department's records)
- Resource states (Editing a published document vs. a draft, or a closed vs. open ticket)
- Time windows (Access allowed only during business hours or project duration)
- Location (Geographic restrictions on sensitive data)
Real-World Analogy
Think of a building superintendent who has keys to apartment 5B. That authorization doesn't mean they can access apartment 5C, even though both are "apartments" they manage. The context (which specific apartment) matters critically.
Common Vulnerability Patterns
Tenant Confusion: A SaaS platform checks if a user has "admin" role but doesn't verify they're admin for the current tenant, allowing cross-tenant privilege escalation.
State Blindness: An API allows document editing if the user is an author, but fails to check whether the document is in "published" state where editing should be locked.
Organization Leakage: An enterprise app verifies team membership but doesn't ensure the resource being accessed belongs to that same team's organizational scope.
Why This Matters
Unlike simple broken access control, these failures pass basic "does the user have permission?" checks but fail the equally important "does the user have permission in this specific situation?" question.
Key Takeaway: Authorization must validate not just who is making a request, but where, when, and under what circumstances that request occurs—context is as critical as identity.