Why these leaks are so common
Firebase and Supabase let front-end apps talk directly to the database. That is what makes them fast to build with — and why one wrong setting can expose everything. The app's public key is meant to be public; the protection comes from security rules (Firebase) or row level security policies (Supabase). If those are missing or too permissive, anyone with the public key can read or write any record.
How the leak happens
Firebase
Test-mode rules such as allow read, write: if true; are often left in place after launch. Others check only that a user is signed in (request.auth != null), which means any signed-up user can read every other user's data.
Supabase
Tables created without row level security enabled are readable and writable by anyone with the anon key. Policies that use true or forget to compare auth.uid() to the row's owner have the same effect.
What attackers do with it
Automated tools find public project IDs and keys in JavaScript bundles, then try to list collections and tables. Exposed data has included customer emails, addresses, chat messages, order histories and admin flags — sometimes with write access, so an attacker can make themselves an admin.
How to check your app
- Review every rule or policy. Every collection or table should have an explicit rule. No
if true, no table without RLS. - Test as a stranger. Using only the public key, try to read a table you should not see.
- Test as another user. Sign up a second account and try to read the first account's records by ID. See IDOR.
- Check write paths. Can a user change their own
roleoris_adminfield? See mass assignment. - Check storage buckets for public listing and overly broad upload rules.
How to fix it
- Deny by default, then allow specific access per collection or table.
- Tie every read and write to the owner:
auth.uid() = user_id(Supabase) orrequest.auth.uid == resource.data.ownerId(Firebase). - Move privileged operations (role changes, payments, admin actions) into server functions using the service role, never the client.
- Keep the service role key on the server only — see API keys exposed in JavaScript.
AI-built apps are especially at risk
Apps generated quickly with AI builders often use these backends and may ship with permissive defaults. See vibe coding security.
Get it tested
Yrzo AI checks for exposed keys, open data access and access-control gaps in apps built on these platforms. Run a free scan or see the Professional report.
Related reading: Vibe Coding Security: Risks in AI-Built Apps and How to Fix Them · API Keys Exposed in JavaScript: How to Find and Fix Them · React App Security Checklist: Front-End Risks That Matter