Hardcoded credentials & committed secrets
Several credential-handling issues, each a must-fix:
-
invite-usersetstempPassword = "password"for every newly-created user (auth.admin.createUser({ email_confirm: true })) and returns the temp password in the HTTP response (the UI displays it to copy). Predictable password + email auto-confirmed = trivially takeover-able new accounts. -
seed-test-datahas zero authentication. It uses the service-role key directly and creates a known-credential super admin ([email protected]/test123456) plus demo cases withaccess_password = "demo1234". If this function is deployed to production, it is a full account-creation backdoor. It must be excluded from any non-dev deploy. -
Committed Supabase secrets.
.envships a live project ref (abpzzrrlaxfdcqndmguk) and the anon key, committed to the repo. The anon key is public-by-design, but the live project is now identifiable and reachable — combined with the publiccompaniesread and seed-test-data, the live PoC backend is exposed. -
invite-userscans the full user list (auth.admin.listUsers(), O(n)) to find an existing user — not a security hole per se, but won't scale and can leak timing.
Rebuild implication
Invites use a one-time email link or a random, never-returned password; auto-confirm off.
Seed/dev tooling is compile-excluded from production and never service-role-open on a public
endpoint. Rotate the committed Supabase project's keys and stop committing .env. Look up
users by indexed email, not a full scan.