Skip to content

Security: DaniloSFValim/openlux

SECURITY.md

Security Policy

๐Ÿ”’ Reporting Security Vulnerabilities

DO NOT open a public GitHub issue for security vulnerabilities.

Report Privately

๐Ÿ“ง Email: danilosfvalim@gmail.com

Include:

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

Response Timeline

  • Within 24 hours: Acknowledgment
  • Within 48 hours: Initial assessment
  • Within 7 days: Fix or mitigation plan
  • Public disclosure: Coordinated after fix is released

๐Ÿ›ก๏ธ Security Practices

This project follows these security practices:

Frontend (HTML/JS)

  • โœ… XSS Prevention: All user input escaped via esc() function
  • โœ… No Credentials: Never hardcoded in frontend code
  • โœ… Secure Headers: X-Frame-Options, X-Content-Type-Options via _headers (Cloudflare Workers)
  • โœ… HTTPS Only: Enforced in production (Cloudflare Workers)
  • โœ… CSP: Content Security Policy via headers

Backend (Supabase)

  • โœ… Row-Level Security: All tables have RLS policies
  • โœ… JWT Authentication: Email/password with secure tokens
  • โœ… SQL Injection Prevention: PostgREST parameterized queries
  • โœ… Rate Limiting: Handled by Supabase
  • โœ… Data Encryption: In transit (HTTPS) and at rest (Supabase)

Repository

  • โœ… No Secrets: .env files in .gitignore
  • โœ… Branch Protection: main branch protected
  • โœ… Code Review: All PRs require review
  • โœ… CI/CD Checks: Security scanning via GitHub Actions
  • โœ… Dependency Management: Keep libraries updated

๐Ÿ” Known Security Considerations

1. Anon Key Exposure

Issue: NEXT_PUBLIC_SUPABASE_ANON_KEY is public (by design in SPA).

Mitigation:

  • Anon key has limited permissions (RLS policies enforce access)
  • Service Role Key is never exposed
  • API rate limiting prevents abuse

2. CORS

Issue: SPA makes requests from browser (CORS visible).

Mitigation:

  • Supabase CORS configured for domain
  • Cookies HttpOnly (automatic in Supabase Auth)
  • No sensitive data in error messages

3. Data Sensitivity

Issue: Infraestrutura pรบblica (luminรกrias) โ€” dados pรบblicos.

Mitigation:

  • No personal data (name, email) exposed publicly
  • User emails protected by Auth role
  • Admin actions logged in audit_logs

๐Ÿงช Testing Security

Local Testing

# Check dependencies
npm audit

# Validate HTML/CSS
npm install -g html-validate
html-validate index.html

# Check for hardcoded secrets
grep -r "BEGIN PRIVATE" .
grep -r "password" .env*

Production Validation

  • HTTPS enabled
  • Security headers present
  • RLS policies enforced
  • No console errors
  • No sensitive data in localStorage

๐Ÿ“‹ Security Checklist for Contributors

Before submitting PR:

  • No hardcoded credentials (.env, keys, tokens)
  • No SQL injection risks (use PostgREST)
  • No XSS (use esc() for user input)
  • Input validation present
  • Error messages don't leak info
  • Dependencies are up to date
  • No console.log() of sensitive data

๐Ÿ“š References


Last Updated: 2026-07-07

There aren't any published security advisories