Description
The Conn Express server currently does not set any security-related HTTP response headers. This exposes the application to common web attacks like XSS, clickjacking, and MIME-sniffing.
Current Behavior
Running curl -I https://conn-delta.vercel.app shows these headers are all missing:
- Content-Security-Policy — prevents XSS and data injection
- X-Frame-Options — prevents clickjacking
- Strict-Transport-Security — enforces HTTPS connections
- X-Content-Type-Options — prevents MIME type sniffing
- Referrer-Policy — controls referrer information leakage
Expected Behavior
The server should send appropriate security headers on every HTTP response to protect users against common web vulnerabilities.
Proposed Solution
The simplest approach is to use the helmet npm package which sets all recommended security headers:
- Run
npm install helmet
- In
server.js, add after the existing middleware block:
const helmet = require('helmet');
app.use(helmet());
- Configure the Content-Security-Policy to allow the specific external resources Conn uses (Google Fonts, Razorpay CDN, etc.)
Environment
- Node.js v18+
- Express.js
- Deployed on Vercel
Additional Context
The admin dashboard also has no X-Frame-Options which means an attacker could embed admin pages in an iframe (clickjacking attack surface).
Description
The Conn Express server currently does not set any security-related HTTP response headers. This exposes the application to common web attacks like XSS, clickjacking, and MIME-sniffing.
Current Behavior
Running
curl -I https://conn-delta.vercel.appshows these headers are all missing:Expected Behavior
The server should send appropriate security headers on every HTTP response to protect users against common web vulnerabilities.
Proposed Solution
The simplest approach is to use the
helmetnpm package which sets all recommended security headers:npm install helmetserver.js, add after the existing middleware block:Environment
Additional Context
The admin dashboard also has no X-Frame-Options which means an attacker could embed admin pages in an iframe (clickjacking attack surface).