Skip to main content

Security for Expresss

Express security practice is hardening an app against common attacks. It includes setting secure HTTP headers with helmet, configuring CORS narrowly, rate limiting, hashing passwords with bcrypt or Argon2, protecting sessions and cookies, validating input and keeping dependencies updated with npm audit.

Stage: Security and Release · Part of the Express roadmap · Last reviewed 19 November 2026

What to learn in Security

Security interview questions

What does CORS protect against and what does it not?

CORS is a browser rule that stops a web page from reading responses from another origin unless the server allows it. It does not protect the API from non-browser clients such as curl, so authentication and authorisation are still required.

Why should you never store passwords as plain text or with a fast hash?

If the database leaks, plain text exposes every account and fast hashes such as MD5 can be brute forced quickly. Use a slow, salted algorithm like bcrypt or Argon2, which makes each guess expensive.

Where Security fits in the Express roadmap

Security belongs to the Security and Release stage (intermediate level). Ship safely.

Back to the full Express roadmap