Security middleware ships with ZinTrust. Turning it on is your job.
Here's what's in the box: Security headers: HSTS, Content-Security-Policy, X-Frame-Options, X-Content-Type-Options CORS: origin validation and preflight handling CSRF: double-submit cookie protection for anything th
- Security headers: HSTS, Content-Security-Policy, X-Frame-Options, X-Content-Type-Options
- CORS: origin validation and preflight handling
- CSRF: double-submit cookie protection for anything that changes state
- XSS sanitization: strips HTML from incoming data, all the way down
Here's the part people miss: a fresh project doesn't turn any of these on for you. You register them globally, or attach them to the routes that need them.
Once they're on, a few things are worth checking:
- Set your CORS origins to the domains you actually serve, not
*. - Make sure your frontend sends the CSRF token on every write.
- Look over your CSP rules if you load third-party scripts.
And every time you add routes, look at what's actually registered on them. Having a middleware package installed doesn't mean a route is protected.
Try it: npm install -g @zintrust/core && zin new my-app
- Docs: https://zintrust.com/security-middleware
- Website: https://zintrust.com
- Source: https://github.com/ZinTrust/zintrust
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.