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

  1. No authentication on "internal" endpoints.
  2. Missing object-level authorization (a user changes an ID to access another user's data).
  3. No input validation, especially in JSON bodies.
  4. Over-exposing data in responses (e.g. returning a full user object including the password hash).
  5. No rate limiting.
  6. Unclear API versioning that keeps old, vulnerable routes alive.
  7. Overly detailed error messages that leak internal structure.
  8. 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.