Blog · 6 Nov 2026 · Updated 7 Nov 2026 · Arsalan Usman

MERN API Security: A Practical Checklist

Node/Express API defaults mapped to the OWASP API Security Top 10 (2023): object-level authorization, auth, mass assignment, rate limits and safe third-party calls.

Most API breaches don't need clever exploits. They come from missing checks. This checklist is for Node.js/Express APIs in MERN-style apps (MongoDB or SQL behind them). It's organised around the OWASP API Security Top 10 (2023), which is the most useful single map of what tends to go wrong. The risk names below are OWASP's. The checklist items are my recommendations.

Authorization first (API1, API3, API5)

OWASP ranks Broken Object Level Authorization first: an endpoint accepts an ID and returns or changes that object without checking who's asking.

  • In every handler that loads by ID, filter by owner or tenant as well: findOne({ _id, tenantId: req.user.tenantId }), never findById(id) alone.
  • Whitelist the fields a client may write. Spreading req.body into a model is how mass assignment happens (OWASP folds this into API3, Broken Object Property Level Authorization).
  • Whitelist the fields you return too. Strip password hashes, internal flags and other users' data in a serializer.
  • Keep admin routes on a separate router with an explicit role check (API5, Broken Function Level Authorization).

Authentication (API2)

  • Use a maintained library or provider rather than hand-rolled token logic.
  • Prefer short-lived access tokens or httpOnly, secure, sameSite session cookies for browsers. Have a revocation path.
  • Rate-limit and log login, signup, password reset and OTP endpoints.

Resource limits and business flows (API4, API6)

  • Cap request body size, page size and upload size.
  • Rate-limit expensive or paid actions (sending SMS, email, AI calls), because OWASP notes these can raise operating costs as well as cause denial of service.
  • For sensitive flows such as checkout, coupon use or signups, think about automated abuse and not just bugs.

Input validation and injection

Validate body, query and params against a schema at the edge (for example with zod or Joi) and reject unknown fields. With MongoDB, make sure query operators can't be smuggled in through user objects. The OWASP Node.js Security Cheat Sheet covers this and related Node-specific issues.

Configuration (API8)

Express's own production security best practices cover TLS, trusted dependencies, secure cookies and security headers. In practice:

  • Turn off verbose error stacks in production and return a consistent error shape.
  • Set security headers (Helmet is the common choice) and a strict CORS allowlist.
  • Keep secrets in environment variables or a secrets manager, never in the repo or front-end bundle. Encrypt stored third-party credentials at rest.

Inventory, SSRF and third-party APIs (API7, API9, API10)

  • Keep a list of deployed endpoints and versions. Remove debug routes and old versions.
  • If the server fetches URLs a user provides (webhooks, image imports), allowlist the destinations to avoid SSRF.
  • Treat data from third-party APIs as untrusted input: validate it, set timeouts and verify webhook signatures.

Keep it maintained

Run npm audit or an equivalent in CI, update dependencies regularly, and add tests for authorization: user A must not read user B's record. Those tests catch the most common OWASP category directly.

Limitations

A checklist isn't a security audit. For apps handling payments or personal data, add threat modelling and an independent review.

Related: MERN development, payment and API integration, AI & business automation, and all posts.