API / backend service: classes L–XL checklist
Note for AI agents: This page is baseline guidance, not an exact prescription. Read it, tell your owner what applies to their project, and get their approval before you change anything. Your project's own rules take precedence. If something important for this project is missing here, suggest it to your owner.
This page continues API / backend service. Read the main page first. This part holds the audit checklist items for classes L–XL.
Audit checklist
+ If it has an admin panel, file uploads, many users or a store app (L)
- Exact versions, 7-day rule, pinned images and actions
- What: Dependencies use exact versions (no
^or~); newly published versions wait at least 7 days before install (critical security fixes excepted, with a written reason and end date); Docker images are pinned by digest and CI actions by full commit ID; major upgrades are done one by one. - How to check: Read dependency files, Dockerfile and CI files; check the release dates of recent upgrades.
- Evidence: Dependency file lines; upgrade notes with release dates.
- What: Dependencies use exact versions (no
- Access to other users’ records is tested on every endpoint
- What: For each endpoint a test changes the identifier in the request and confirms the user cannot reach someone else’s data (IDOR/BOLA).
- How to check: List endpoints that take an ID; find the matching negative test for each.
- Evidence: Test names per endpoint.
- Rate limits are per account and tolerate shared IPs
- What: Limits are per account; unauthenticated endpoints also have IP limits, tuned for mobile carriers that put thousands of users behind one IP (CGNAT).
- How to check: Read the limiter configuration and thresholds; test many users from one IP.
- Evidence: Limit table; test results.
- Rate limit responses are standard
- What: When limits apply the API returns 429 with a Retry-After header; clients are documented to back off.
- How to check: Exceed a limit and read the response.
- Evidence: Response headers.
- Writes can be retried safely
- What: Create and payment-like calls accept an idempotency key so retries do not duplicate work.
- How to check: Send the same write twice with the same key.
- Evidence: Test showing one effect.
- Changes are versioned and compatible
- What: Breaking changes get a new version; the old one keeps working during a stated period.
- How to check: Read the versioning rule and the change log.
- Evidence: Policy text; changelog.
- CSRF, CORS, security headers and mass assignment are handled
- What: CSRF protection is on; CORS has an allow list; security headers (HSTS, nosniff, CSP, frame ban, Referrer-Policy) are set; extra fields in request bodies cannot change privileged state.
- How to check: Request the site and read headers; send an unexpected field such as
rolein a request body; read the CORS configuration. - Evidence: Header output; test for the extra field; CORS list.
- No “check then write” races
- What: State changes use conditional updates; counters are incremented in the database, not read and rewritten in code.
- How to check: Search for read-then-update patterns on balances, counters and status fields.
- Evidence: Code showing conditional updates; concurrency test.
- Lists use cursor pagination and indexes are checked
- What: Every list is paginated by cursor (no OFFSET, no unbounded queries); new queries are checked with
EXPLAIN; indexes are added to both schema and migration. - How to check: Search for
OFFSETand queries withoutLIMIT; look for EXPLAIN notes; compare schema and migration indexes. - Evidence: Endpoint list with cursor parameters; EXPLAIN output for new queries.
- What: Every list is paginated by cursor (no OFFSET, no unbounded queries); new queries are checked with
- Schema changes use a migration ledger
- What: Schema changes are numbered, hand-written files; applied files are never edited or deleted; automatic schema sync is never run on a database with data.
- How to check: Look at the migrations folder history; search scripts for automatic sync commands (for example
drizzle-kit push). - Evidence: Migration folder; absence of sync commands in deploy scripts.
- Server-side requests to user-supplied addresses are restricted
- What: If the server fetches a URL given by a user (previews, imports, webhooks), it blocks internal addresses and uses an allow list.
- How to check: Search for server-side fetch calls that take user input; try
http://127.0.0.1and cloud metadata addresses. - Evidence: Code with allow list; blocked-request test.
- Unknown or missing settings stop the process
- What: The process refuses to start with an unrecognized environment value or a missing required setting; there is no silent fallback; checks ask “is this development or test?” rather than “is this not production?”; endpoint groups can be locked by a single feature-lock file.
- How to check: Start the app with a missing required variable and a wrong environment name; read the lock file.
- Evidence: Startup failure message; lock file.
- Container is hardened and stateless
- What: Multi-stage image, non-root user, base image pinned by digest, health check endpoint; runtime versions identical in CI, local and production; no state in the container disk (sessions and files live in the database or object storage).
- How to check: Read the Dockerfile; run
docker inspectfor the user; look for files written to the container disk. - Evidence: Dockerfile lines; health endpoint response.
- End-to-end tests, short CI run, guards, screenshot checks
- What: End-to-end tests exist; a short run happens in CI; guards (tests that enforce rules) protect important rules; screen checks cover both themes and all languages; new end-to-end tests pass three runs in a row before merging; a red test is fixed in code, never silenced.
- How to check: Read the CI file and test folders; look for skipped tests and quarantined guards.
- Evidence: CI run, guard inventory, three-run log.
- Limits and capacities are listed in one place
- What: Every rate limit and capacity is in one list: value, window, capacity reasoning, what an attacker could do, side effects.
- How to check: Find the inventory document and compare it with limiter code.
- Evidence: Inventory document.
- Industry standard list (S1–S16) is kept and “busy” is handled correctly
- What: A list of standard mechanisms (retries with backoff and jitter, idempotency keys, early load shedding, timeouts, circuit breaker, caching, background job guarantees, graceful shutdown, rate limits, security headers, monitoring, bounded queues, one error path, compression) with a status per item; capacity problems return 429 or 503 with Retry-After, never 500.
- How to check: Find the list; test overload and read the status code and headers.
- Evidence: List with status; overload test output.
+ If it targets millions of users (XL)
- Single version catalog and install-script approval
- What: All versions live in one catalog file; packages that run install scripts need approval; the vulnerability scan fails on medium and above; a global version override is written per major line.
- How to check: Read the catalog file and package manager settings.
- Evidence: Catalog file; scan configuration.
- Load tests with a coverage map and an attack drill
- What: Load tests use real request patterns (burst, long run, writes, a huge account, a database restart, media upload, attack drill); every endpoint and scheduled job is in a coverage map; a new endpoint without a map entry fails a guard; with hit-rate “busy” responses at target steps counted as findings.
- How to check: Read the load test folder and the map; check the guard.
- Evidence: Latest run report; coverage map.
- Scale rules are measured
- What: One event updates only its own item; memory, timers and subscriptions stay bounded on long lists; data loads gradually near the end of the list; small frequent writes are batched; query counts per endpoint have a guard; hot single rows use sharded counters; optimizations are decided by measurement.
- How to check: Run a long-scroll test and read the query count guard output.
- Evidence: Measurements before and after; guard test name.
- Leak detection and key rotation
- What: Decoy keys raise an alarm when used; cloud audit alerts exist for new service accounts and permission changes; unusual usage alarms exist; there is a key rotation plan that does not end sessions; an error tool strips personal data and samples.
- How to check: Read the monitoring and alert configuration; find the rotation plan.
- Evidence: Alert rules; rotation document.
- Disaster recovery plan with RPO and RTO
- What: A written plan states acceptable data loss (RPO), recovery time (RTO) and step-by-step recovery.
- How to check: Find the plan; check that a drill was run.
- Evidence: Plan and drill record.
Sources
- OWASP API Security Top 10 – 2023 — OWASP
- REST Security Cheat Sheet — OWASP Cheat Sheet Series
- Authorization Cheat Sheet — OWASP Cheat Sheet Series
- Insecure Direct Object Reference Prevention Cheat Sheet — OWASP Cheat Sheet Series
- Mass Assignment Cheat Sheet — OWASP Cheat Sheet Series
- Server Side Request Forgery Prevention Cheat Sheet — OWASP Cheat Sheet Series
- RFC 9457: Problem Details for HTTP APIs — IETF
- RFC 6585: Additional HTTP Status Codes — IETF
- Retry-After header — MDN Web Docs
- Idempotent (glossary) — MDN Web Docs
- The Idempotency-Key HTTP Header Field (Internet-Draft) — IETF
- REL05-BP03 Control and limit retry calls — AWS
- Well-Architected: make mutating operations idempotent — AWS
- PostgreSQL: EXPLAIN — PostgreSQL Global Development Group
- The Twelve-Factor App: III. Config — 12factor.net
- Pro Build Guide v1.2: compiled team practices — Pro Build Guide