API Security Checklist: 26-Item Guide for REST & GraphQL

Share

TL;DR

This 26-item checklist covers the most critical security issues in REST and GraphQL APIs: authentication, authorization, input validation, rate limiting, and CORS configuration. 8 critical items must be fixed before launch, 15 important items within the first week, and 3 recommended items when you can.

Quick Checklist (5 Critical Items)

Authentication 4

Authorization 4

Input Validation 5

Rate Limiting 3

CORS Configuration 3

Error Handling 3

::checklist-item{label="Generic error messages for auth failures" description=""Invalid credentials" not "User not found" or "Wrong password". How to secure error messages"} ::

GraphQL Specific 4

API Security Fundamentals

Every API endpoint should answer four questions: Who is making this request (authentication)? Are they allowed to do this (authorization)? Is the data they sent safe (validation)? Are they making too many requests (rate limiting)?

What is IDOR and how do I prevent it?

IDOR (Insecure Direct Object Reference) occurs when users can access other users' data by changing IDs in requests. Prevent it by always verifying that the authenticated user owns or has permission to access the requested resource before returning or modifying it.

Should I use wildcard CORS in production?

Never use wildcard (*) CORS in production for APIs that handle sensitive data. Specify exact allowed origins. If using cookies for authentication, you must specify origins anyway since credentials mode doesn't work with wildcards.

Why validate input on the server if I validate on the client?

Client-side validation can be bypassed by anyone with browser DevTools or API tools like Postman. It's for user experience, not security. Always validate on the server - that's where security decisions must be made.

Scan Your API

Our scanner checks for authentication issues, authorization flaws, and common API vulnerabilities.

Start Free Scan
Security Checklists

API Security Checklist: 26-Item Guide for REST & GraphQL