Thank you for helping keep Zava Gift Exchange secure!
- Keep all npm packages updated
- Run
npm auditbefore submitting PRs - Report vulnerable dependencies privately first
- Never commit secrets (API keys, tokens, passwords)
- Use environment variables for sensitive configuration
- Sanitize user input on both frontend and API
- Use HTTPS for all communications
- Enable CORS restrictions appropriately
- Use
crypto.randomUUID()/crypto.randomInt()for all token and code generation — neverMath.random() - Use
safeCompare()fromapi/src/shared/game-utils.tsfor all token comparisons (timing-safe viacrypto.timingSafeEqual) - Enforce input length limits via
INPUT_LIMITSinapi/src/shared/types.ts(max 100 participants, name: 80 chars, notes: 2000 chars) - Never expose
error.messageor stack traces in API error responses
- Game creation: 10 requests per minute per IP
- Email sending: 20 requests per minute per IP
- GET/PATCH endpoints: 60 requests per minute per IP
- Rate limiter is in-memory (
api/src/shared/rate-limiter.ts); for stronger enforcement across multiple instances, consider Azure API Management or Cosmos DB-based counters
- Strict CSP with no
unsafe-evaland nounsafe-inlinefor scripts Strict-Transport-Security(HSTS) with 1-year max-ageframe-ancestors 'none'to prevent clickjackingPermissions-Policy: camera=(), microphone=(), geolocation=()to disable unused browser APIs- See
staticwebapp.config.jsonfor the full CSP header
- HTML escaping via
escapeHtml()inapi/src/shared/email-service.tsfor all user content embedded in email templates - Service worker caches static assets (JS, CSS, images, fonts) and navigation (HTML) requests, but never API responses
- localStorage game data is automatically cleaned up after 30 days
- Game code collision detection prevents code reuse
- Cosmos DB emulator TLS bypass is hard-blocked in production environments
- API error responses never expose
error.messageor stack traces
- Key-based auth for Cosmos DB via
COSMOS_KEYdeployed through Bicep (RBAC role provisioned for future keyless migration) - Rotate secrets regularly
- Enable Application Insights for monitoring
- Use resource group RBAC for access control
- Enable audit logging
- Budget alerts available via
budgetAmountBicep parameter
This application uses the following third-party services:
- Azure Communication Services: For sending notification emails (optional, only when explicitly requested by users)
This project uses:
- CodeQL: Static code analysis for security vulnerabilities
- Dependency Check: Identifies known vulnerable dependencies
- npm audit: Runtime dependency vulnerability scanning
These run automatically on all pull requests and merges to main.
- Acknowledgment: Within 48 hours
- Initial assessment: Within 1 week
- Patch release: As soon as possible after confirmation
- Public disclosure: After patch is available
We follow responsible disclosure practices:
- Issue reported privately
- We confirm and create a fix
- Security update released
- Vulnerability publicly disclosed after update is available
If you prefer a different disclosure timeline, please let us know in your initial report.