Authorization Vulnerabilities Overview
Authorization Vulnerabilities Overview
Missing Function Level Authorization
Missing Function Level Authorization
Insecure Direct Object References (IDOR)
Insecure Direct Object References (IDOR)
- Implement proper access control checks for each object access
- Use indirect references that are mapped to actual database IDs
- Validate that the current user has permission to access the requested object
- Implement proper error handling that doesn’t reveal sensitive information
- Use database queries that include user permissions in the selection criteria
Broken Object Level Authorization
Broken Object Level Authorization
Privilege Escalation
Privilege Escalation
- Implement strict role checks for sensitive operations
- Prevent users from modifying their own roles or permissions
- Validate that users can only access or modify their own data unless explicitly authorized
- Implement proper access control for administrative functions
- Log and monitor privilege changes
Missing Authorization Headers
Missing Authorization Headers
Improper Access Control
Improper Access Control
- Verify user permissions for every protected resource
- Implement role-based or attribute-based access control
- Apply the principle of least privilege
- Use declarative security when possible
- Centralize access control logic
- Regularly audit access control implementations
JWT Without Signature Verification
JWT Without Signature Verification
- Always verify JWT signatures using the appropriate algorithm and key
- Validate all JWT claims (expiration, issuer, audience, etc.)
- Use strong, properly secured signing keys
- Implement token expiration and refresh mechanisms
- Consider using a JWT library that handles security best practices
Relying on Client-Side Authorization
Relying on Client-Side Authorization
Insufficient Authorization Granularity
Insufficient Authorization Granularity
Hardcoded Roles or Permissions
Hardcoded Roles or Permissions
- Use a configurable permission system
- Implement declarative security with annotations or configuration
- Store permissions in a database or configuration file
- Use role hierarchies or permission inheritance when appropriate
- Implement a centralized authorization service
Missing Re-Authentication for Sensitive Operations
Missing Re-Authentication for Sensitive Operations
- Require password verification for sensitive operations
- Implement step-up authentication for high-risk actions
- Consider using multi-factor authentication for critical operations
- Implement proper session management
- Log all sensitive operations
Insecure Authorization Decisions
Insecure Authorization Decisions
Lack of Context-Aware Authorization
Lack of Context-Aware Authorization
Failure to Validate Authorization on Each Request
Failure to Validate Authorization on Each Request