APIs are often a direct path to sensitive data, but because they're "behind the scenes," their security sometimes gets less attention than the main UI.
Eight common mistakes
- No authentication on "internal" endpoints.
- Missing object-level authorization (a user changes an ID to access another user's data).
- No input validation, especially in JSON bodies.
- Over-exposing data in responses (e.g. returning a full user object including the password hash).
- No rate limiting.
- Unclear API versioning that keeps old, vulnerable routes alive.
- Overly detailed error messages that leak internal structure.
- Storing API keys in client-side code.
The core principle
Every endpoint needs independent authentication, authorization, and validation — don't assume it's safe just because "only the mobile app calls it."
Every endpoint needs authentication, authorization, and input validation.