If you discover a security vulnerability in MBTQ.dev, please report it by:
- DO NOT create a public GitHub issue
- Email security concerns to: [Repository Owner]
- Include detailed information about the vulnerability
- Allow reasonable time for the issue to be addressed before public disclosure
| Version | Supported |
|---|---|
| 1.x.x | β |
- β
Safe to expose:
VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY - β Never expose: Service role keys, private API keys, database credentials
- All sensitive credentials should be stored in server environment variables
- Use
.envfiles locally (never commit these) - Use GitHub Secrets, AWS SSM, or similar for production
- Always use HTTPS in production
- Implement Row Level Security (RLS) in Supabase
- Validate user sessions on both client and server
- Use secure password requirements:
- Minimum 8 characters
- Mix of uppercase, lowercase, numbers, symbols
- Implement rate limiting on authentication endpoints
// Example: Sanitize user input
import DOMPurify from 'isomorphic-dompurify';
function sanitizeInput(input: string): string {
return DOMPurify.sanitize(input, {
ALLOWED_TAGS: [],
ALLOWED_ATTR: []
});
}- β Use Supabase client (parameterized queries)
- β Use prepared statements for raw SQL
- β Never concatenate user input into SQL queries
- β React automatically escapes JSX content
- β
Use
DOMPurifyfor any HTML rendering - β Avoid
dangerouslySetInnerHTMLunless absolutely necessary
- β Use SameSite cookies
- β Implement CSRF tokens for state-changing operations
- β Verify Origin/Referer headers
// Example: Rate limiting middleware
import rateLimit from 'express-rate-limit';
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // limit each IP to 100 requests per windowMs
message: 'Too many requests, please try again later.'
});
app.use('/api/', limiter);// Server CORS setup
const cors = require('cors');
const corsOptions = {
origin: process.env.CORS_ORIGIN?.split(',') || 'http://localhost:5173',
credentials: true,
optionsSuccessStatus: 200
};
app.use(cors(corsOptions));Recommended security headers for production:
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline';
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000; includeSubDomains
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: geolocation=(), microphone=(), camera=()
- All environment variables are properly configured
- No secrets committed to git repository
- HTTPS is enforced
- Security headers are configured
- Rate limiting is enabled
- Input validation is implemented
- SQL injection prevention is verified
- XSS prevention is tested
- CSRF protection is enabled
- Authentication is secure
- Authorization checks are in place
- Error messages don't leak sensitive information
- Logging doesn't include sensitive data
- Dependencies are up to date
- Vulnerability scan passed
- Penetration testing completed (if applicable)
- Run
npm auditweekly - Update dependencies monthly
- Review access logs regularly
- Monitor for unusual activity
- Backup data regularly
- Test disaster recovery plan
- Review and update security policies
In case of a security incident:
- Contain: Immediately isolate affected systems
- Assess: Determine scope and impact
- Notify: Inform affected users and stakeholders
- Remediate: Fix the vulnerability
- Document: Record incident details and response
- Review: Analyze and improve security measures
- OWASP Top 10
- Supabase Security Best Practices
- Node.js Security Best Practices
- React Security Best Practices
This repository uses:
- Dependabot: Automatic dependency updates and security alerts
- npm audit: Regular vulnerability scanning
- GitHub Security Advisories: Automated vulnerability detection
Before adding new dependencies:
- Check package reputation and maintenance status
- Review package size and dependencies
- Check for known vulnerabilities
- Verify package authenticity
- Review source code if critical
This security policy is part of the MBTQ.dev project and follows the same license terms.
Last Updated: 2025-12-15
Contact: GitHub Issues (for general security questions, not vulnerabilities)