Learn how to write secure code to protect web applications from common vulnerabilities, with examples of dos and don’ts.
npm audit
to identify and fix insecure dependencies. Regularly update your packages to the latest, non-vulnerable versions.
.env
Files.env
files and access them via process.env
in your code.
Bad Practice: Hardcoding secrets in code
.env
files.
To learn more ↗️
https://example.com/reset-password?token=12345
), the page may load external resources, potentially exposing the URL with the token.
To learn more ↗️
Referrer-Policy
on both the backend (for global settings) and the frontend (for specific pages, especially in SPA frameworks like React or Next.js). This policy controls the referrer information sent to other domains, protecting sensitive data in the URL.
react-helmet
(React) or set headers in _document.js
(Next.js) to include the Referrer-Policy
.