Skip to content

Security: molaraiche/comptable-ai-chat

Security

SECURITY.md

Security Policy

πŸ”’ Security Measures

This application implements several security measures to protect users and data:

1. Environment Variables

  • βœ… API URLs stored in .env.local (not committed to git)
  • βœ… .env* files are gitignored
  • βœ… Example template provided in .env.example

2. Security Headers

  • βœ… X-Frame-Options: Prevents clickjacking attacks
  • βœ… X-Content-Type-Options: Prevents MIME-type sniffing
  • βœ… X-XSS-Protection: Enables browser XSS protection
  • βœ… Strict-Transport-Security: Forces HTTPS connections
  • βœ… Content-Security-Policy: Restricts resource loading
  • βœ… Referrer-Policy: Controls referrer information
  • βœ… Permissions-Policy: Disables unnecessary browser features

3. Rate Limiting

  • βœ… 3 questions per IP address
  • βœ… 72-hour reset period
  • βœ… Server-side enforcement
  • βœ… Prevents API abuse

4. Data Privacy

  • βœ… No user authentication required
  • βœ… No personal data collected
  • βœ… Chat history stored locally (browser localStorage)
  • βœ… No server-side message storage
  • βœ… Privacy-focused analytics (Vercel Analytics - aggregated data only)
  • βœ… Performance monitoring (Vercel Speed Insights - no PII)

5. API Security

  • βœ… CORS enabled for specific domain
  • βœ… HTTPS-only connections
  • βœ… No API keys exposed in frontend
  • βœ… Rate limiting on API calls

6. Frontend Security

  • βœ… React's built-in XSS protection
  • βœ… No dangerouslySetInnerHTML usage
  • βœ… Input sanitization via React
  • βœ… Markdown rendering with safe defaults

🚨 Reporting Security Issues

If you discover a security vulnerability, please email: contact@molaraiche.com

Please include:

  • Description of the vulnerability
  • Steps to reproduce
  • Potential impact
  • Suggested fix (if any)

Do not open public issues for security vulnerabilities.

πŸ” Best Practices for Deployment

Environment Variables

# Never commit these files:
.env.local
.env.production.local
.env.development.local

# Always use environment variables for:
- API endpoints
- API keys
- Secret tokens
- Database URLs

Vercel Deployment

  1. Add environment variables in Vercel dashboard
  2. Set NEXT_PUBLIC_API_URL in project settings
  3. Enable automatic HTTPS
  4. Use Vercel's built-in DDoS protection

Self-Hosting

  1. Use a reverse proxy (nginx, Caddy)
  2. Enable HTTPS with Let's Encrypt
  3. Configure firewall rules
  4. Set up rate limiting at proxy level
  5. Regular security updates

πŸ›‘οΈ Security Checklist

Before deploying to production:

  • Environment variables configured
  • .env.local not committed to git
  • HTTPS enabled
  • Security headers verified
  • Rate limiting tested
  • CSP policy reviewed
  • Dependencies updated
  • No console.log in production
  • Error messages don't expose sensitive info
  • API endpoint secured

πŸ“‹ Security Audit Log

Date Version Changes
2026-04-27 1.1.0 Added Vercel Analytics & Speed Insights
2026-04-27 1.0.0 Initial security implementation

πŸ”„ Regular Maintenance

Weekly

  • Check for dependency updates
  • Review rate limit logs
  • Monitor error logs

Monthly

  • Run npm audit
  • Update dependencies
  • Review security headers
  • Check CSP violations

Quarterly

  • Full security audit
  • Penetration testing
  • Review access logs
  • Update security policies

πŸ“š Resources

βš–οΈ Compliance

This application:

  • βœ… Does not collect personal data (GDPR compliant)
  • βœ… Uses localStorage (user's device only)
  • βœ… No cookies used
  • βœ… No third-party tracking
  • βœ… Transparent data usage

πŸ”’ Encryption

  • βœ… HTTPS enforced (TLS 1.3)
  • βœ… Secure WebSocket connections
  • βœ… No sensitive data in URLs
  • βœ… No sensitive data in localStorage

Last Updated: April 27, 2026
Version: 1.1.0
Maintained by: Molaraiche

There aren't any published security advisories