We release patches for security vulnerabilities for the following versions:
| Version | Supported |
|---|---|
| 1.x.x | ✅ |
| < 1.0 | ❌ |
We take the security of this project seriously. If you believe you have found a security vulnerability, please report it to us as described below.
- Open a public GitHub issue for security vulnerabilities
- Disclose the vulnerability publicly before it has been addressed
Report security vulnerabilities via email to: [INSERT CONTACT EMAIL]
Please include the following information in your report:
- Type of vulnerability (e.g., NoSQL injection, XSS, authentication bypass)
- Full paths of affected source files (if known)
- Location of the affected source code (tag/branch/commit or direct URL)
- Step-by-step instructions to reproduce the vulnerability
- Proof-of-concept or exploit code (if possible)
- Impact of the vulnerability including how an attacker might exploit it
- Acknowledgment: We will acknowledge receipt of your vulnerability report within 48 hours
- Updates: We will send you regular updates about our progress
- Verification: We will work to verify and reproduce the vulnerability
- Timeline: We aim to release a fix within 90 days of receiving the report
- Credit: We will credit you for the discovery when we announce the fix (unless you prefer to remain anonymous)
-
Never commit secrets
- No API keys, passwords, or tokens in code
- Use environment variables for sensitive data
- Check
.gitignoreincludes common secret files
-
Input validation
- Always validate and sanitize user input
- Use Zod schemas with
validate()middleware - Never trust client-side data
-
NoSQL Injection prevention
- Never pass raw
req.bodydirectly into MongoDB queries - Use Zod to validate and parse input before DB operations
- Avoid
$whereand$exprwith user input
- Never pass raw
-
Authentication & Authorization
- Implement proper JWT token validation
- Use guards for all protected routes
- Verify user permissions before sensitive operations
- Implement rate limiting on auth endpoints
-
Dependency management
- Keep dependencies up to date
- Review Dependabot alerts
- Run
npm auditregularly - Use lock files (
package-lock.json)
-
Environment Configuration
# Use strong secrets JWT_SECRET=<strong-random-string-minimum-32-characters> # Enable CORS appropriately CORS_ORIGIN=https://your-domain.com # Use secure database credentials MONGODB_URL=mongodb+srv://user:password@cluster.mongodb.net/dbname
-
HTTPS Only
- Always use HTTPS in production
- Redirect HTTP to HTTPS
- Use secure cookies (
secure: true, httpOnly: true)
-
Rate Limiting
- Implement rate limiting on all endpoints
- Extra strict limits on auth endpoints
- Use IP-based and user-based limits
-
Security Headers
- Helmet.js is configured for security headers
- Configure CSP appropriately
- Enable HSTS
-
Monitoring & Logging
- Winston logs security events to file
- Monitor for suspicious activity
- Set up alerts for critical events
- Never log sensitive information (passwords, tokens)
- All database queries use Mongoose ODM methods
- Zod validation prevents NoSQL injection by type-checking input
- Database credentials stored in environment variables
- Zod env validation crashes the app if required vars are missing
- JWT tokens with configurable expiration
- Password hashing with bcrypt (cost factor 12+)
- Rate limiting on login/register attempts
- Sensitive fields excluded from responses (
select: false)
- CORS configured for specific origins (via
CORS_ORIGINenv var) - Helmet.js for security headers
- Request validation with Zod middleware
- Rate limiting with Redis-backed store (express-rate-limit)
We will announce security updates through:
- GitHub Security Advisories
- Email to registered users (if applicable)
- CHANGELOG.md with
[SECURITY]prefix
This project aims to comply with:
- OWASP Top 10
- SANS Top 25
- CWE/SANS Top 25 Most Dangerous Software Errors
We thank the following researchers for responsibly disclosing security vulnerabilities: