API Security: What Goes Wrong and How to Fix It
APIs are the new attack surface. Most breaches now involve an API vulnerability.
As applications move to microservices and SPAs, APIs have become the primary attack vector. OWASP now has a dedicated API Security Top 10.
Common API vulnerabilities
- Broken Object Level Authorization (BOLA) - Accessing objects you shouldn't by changing IDs
- Broken Authentication - Weak token handling, no rate limiting
- Excessive Data Exposure - Returning more data than the client needs
- Lack of Rate Limiting - No protection against brute force
Defense checklist
- Implement proper authentication on every endpoint
- Validate and sanitize all inputs
- Rate limit by IP and by user
- Use HTTPS everywhere
- Return only the data the client needs
- Log and monitor all API access
- Version your APIs