OOmnistu

Blog / Engineering Playbooks

Engineering Playbooks

REST API security: a checklist for app teams

Review REST API transport, authentication, authorization, input handling and error controls using OWASP's security guidance.

OOmnistu
Reviewed 2026-11-16 · 3 min read

This post summarises OWASP's REST Security Cheat Sheet, which we fetched on 15 November 2026. We did not read the sheets it links to (JWT, IDOR, TLS, XXE) or the end of its HTTP status code section. Everything attributed is OWASP's. For API design choices, see our API design basics post; for limits, see API rate limiting.

Stay stateless, check every call

OWASP says REST APIs are stateless and each call must check that the caller may do the requested operation. Passing state from the client to the backend to make a service technically stateless is, in its words, an anti-pattern prone to replay and impersonation.

The checklist

  1. HTTPS only. It protects passwords, API keys and tokens in transit. For highly privileged services, consider mutually authenticated client certificates.
  2. Access control at every non-public endpoint. Decide locally at each endpoint to cut latency and coupling, and centralise sign-in in an identity provider that issues access tokens.
  3. JWTs, if you use them. Require a signature or MAC and never accept alg: none. Prefer signatures over MACs, because with a MAC every service that can verify can also mint tokens, so one compromised service compromises all. Verify with your own configured algorithm, never the one named in the token header. For API access, require and validate iss, aud and exp (and nbf if your token profile requires it). Validate nbf whenever it is present as well. Since a JWT can outlive a logout, the sheet suggests a denylist of the token's jti after explicit session termination.
  4. API keys help against farming and excess bills for public endpoints, and are used to sell access plans, but are easy to compromise when given to third parties. Where an endpoint is API-key-protected, require the key on every call, return 429 when requests come too fast, revoke on violation, and do not rely on them alone for sensitive or high-value resources.
  5. Allowlist HTTP methods; reject others with 405 and check the caller may use that method on the collection, action and record.
  6. Block out-of-order calls. The sheet's checkout example: calling confirm without paying. Validate workflow state on the server for every request, model workflows as states, bind tokens to stages, and reject invalid transitions. Each endpoint can pass its own authorization check and still allow this.
  7. Validate input: type, length, range, format; strong types; reject unexpected content; request size limit with 413; log validation failures; use a secure parser (and one safe against XXE for XML).
  8. Validate content types. Require a supported Content-Type on requests with a body (415 otherwise), do not copy the Accept header into the response Content-Type, pick a supported type that fits Accept or return 406, and send the right type (application/json, not application/javascript).
  9. Management endpoints: the sheet says to use strong authentication, such as multi-factor, if they must be reachable over the internet, and to prefer separate ports or hosts, restricted by firewall rules. We read only the end of that section.
  10. Generic errors, with no stack traces or internal hints.
  11. Audit logs before and after security events, including token validation errors; sanitise log data against log injection.
  12. Security headers for responses browsers may consume: Cache-Control: no-store, Content-Security-Policy: frame-ancestors 'none', correct Content-Type, Strict-Transport-Security, X-Content-Type-Options: nosniff, and legacy X-Frame-Options: DENY. Many of these are browser directives and offer little or no protection to a non-browser client; no-store still matters to applicable HTTP caches and does not control every application-managed cache.
  13. CORS: disable if cross-domain calls are not expected; otherwise list origins as specifically as possible.
  14. No secrets in URLs. Keys and tokens belong in headers or the body, because URLs end up in server logs.

Questions for your team

Limits

One OWASP page, mostly read. It reflects OWASP's current recommendations on the fetch date and may change. No statistics or product advice. Which headers matter depends on whether browsers call your API.

By Omnistu.

Sources

Previous
Push notifications with Firebase: notification messages vs data messages