API Security
- Broken Object Level Authorization
- Aka IDOR (In-secured Direct Object Reference) - Accessing unauthorized objects using same token due to lack of authorization checks
- Mitigation
- implement authorization checks with user policies and hierarchy
- dont rely on IDs sent from client. Use IDs from session
- Check authorization each time there is client request to access database
- Use random non guessable IDs (UUIDs)
- Broken Authentication
- Due to Lack of best practices.
- Mitigation
- Check all possible ways to authenticate to all APIs
- Password reset APIs and one-time links also allow users to get authenticated and should be protected just as seriously
- Use standard authentication, token generation, password storage, MFA
- Use short-lived access tokens
- Authenticate your apps (so you know who is talking to you)
- OAuth token is not authentication (hotel key analogy)
- Use stricter rate-limiting for authentication, implement lockout policies and weak password checks
- Excessive Data Exposure
- Exposing critical data to avoid regular updates ( eg. using * for db queries)
- Mitigation:
- Never rely on client to filter data
- Review all responses, only return what the API consumers really need
- Define schemas of all the API responses
- Don't forget about error responses
- Identify all the sensitive or Pll info and justify its use
- Enforce response checks to prevent accidental data and exception leaks
- Lack of Resources & Rate Limiting
- Denial of service to overwhelm the server
- Mitigation:
- Rate limiting
- Payload size limits
- Rate limits specific to API methods, clients, addresses
- Checks on compression ratios
- Limits on container resources
- Check parsers on recursion vulnerabilities
- Missing Function Level Authorization
- Similar to broken object level authorization
- Mitigation:
- Don't rely on client app to enforce admin access
- Deny all access by default
- Only allow operation to users that belong to the appropriate group or role
- Properly design and test authorization
- Mass Assignment
- Security Misconfiguration
- Injection
- Improper Assets Management
- Insufficient Logging & Monitoring
No comments:
Post a Comment