Metastatic.Analysis.BusinessLogic.IncorrectAuthorization
(Metastatic v0.10.4)
View Source
Detects incorrect authorization patterns (CWE-863).
This analyzer identifies weak or flawed authorization logic patterns that could allow unauthorized access even when some authorization exists.
Common Incorrect Authorization Patterns
- Authorization after action - Performing the operation before checking permissions
- Client-side only authorization - Relying on UI to hide options
- Role check without resource check - Checking role but not resource ownership
- Negated logic flaws - Using complex negation that can be bypassed
- Default allow - Allowing access unless explicitly denied
Cross-Language Applicability
Incorrect authorization affects all languages and frameworks.
Detection Strategy
Detects patterns where:
- Authorization check appears after sensitive operation
- Authorization uses only role check without resource verification
- Complex boolean logic that might have flaws
- Default-allow patterns instead of default-deny