Common API security pitfalls
summary
APIs fail most often for concrete mistakes: missing authorization checks leading to IDORs, decoding but not verify JWT signature, sharing HMAC secrets between services instead of use RSA/JWKS with kid and key rotation, and misconfigured CORS that returns the Origin header back. Practical fixes: audit every endpoint for auth, enforce strict CORS and application/json preflight checks, store session state correctly (cookies for browser features, auth header when appropriate), use parameterized queries and output encoding, and split public and private surfaces via origin isolation.
AI-written summary · about
chapters (14)
- 0:00Introduction to API security
- 2:57Baseline security with smartwatches
- 5:02Unsecure direct object references
- 7:50Lack of proper authorization
- 10:14Stateless API session management
- 13:26Misusing JWT decode function
- 16:39JWT signature verification
- 19:30Key rotation in JWT
- 21:57Cookies vs authorization headers
- 26:11Cross-site request forgery risks
- 28:14CORS policy implementation
- 31:23Input validation limitations
- 33:30Failure to compartmentalize
- 34:55Security mindset and Q&A
