Skip to content

Harden security posture: remove client-side service role key, sanitize inputs, and add security utilities - #1

Open
cto-new[bot] wants to merge 1 commit into
mainfrom
security-audit-vuln-scan-suggestions
Open

Harden security posture: remove client-side service role key, sanitize inputs, and add security utilities#1
cto-new[bot] wants to merge 1 commit into
mainfrom
security-audit-vuln-scan-suggestions

Conversation

@cto-new

@cto-new cto-new Bot commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

Summary

Harden security posture by removing client-side service role key and adding sanitization utilities. Introduce security tooling and tighten production build and CORS configurations.

Details

  • Remove client-side exposure of server-side keys (service role key) and improve env validation
  • Add security utilities for HTML sanitization, URL safety, and rate limiting
  • Sanitize content in admin notification previews to prevent XSS
  • Implement rate limiting for bulk notification sends
  • Tighten production build: drop console logs, enhance security headers and CORS handling
  • Add SECURITY_POLICY.md and SECURITY_AUDIT_REPORT.md documenting security posture and governance
  • Ensure server-side secrets are not exposed in client code; update deployment guidance

…ce role key and adding sanitization utilities

This commit strengthens security by removing sensitive server-side keys from client configs, introducing a security utility module, and hardening content handling and builds.
- Remove VITE_SUPABASE_SERVICE_ROLE_KEY exposure from client environment and update env validation
- Add src/utils/security.js with HTML escaping, sanitization, URL safety, and rate limiting helpers
- Update auth/notification flows to sanitize user-provided content before rendering previews
- Introduce rate limiting for notification sending
- Tighten production build: drop console logs, add security headers / restrict CORS in config
- Add security policy and audit docs (SECURITY_POLICY.md, SECURITY_AUDIT_REPORT.md)
- Add checks to ensure server-side secrets are not exposed on client

BREAKING CHANGE: Client-side service role key removed; move server-side secrets to secure envs and update deployments accordingly.
@vercel

vercel Bot commented Nov 13, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
basic-intelligence-ai-school Ready Ready Preview Comment Nov 13, 2025 8:44am
basic-intelligence-ai-schools Ready Ready Preview Comment Nov 13, 2025 8:44am
basic-intelligence-ai-schoolss Ready Ready Preview Comment Nov 13, 2025 8:44am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants