Home Products
VivaGuard TamperCheck Vybscan
About Blog Book a Demo

How do I check a Supabase or Firebase app for missing row level security?

Manjula Sridhar Nov 19, 2026 6 min read
← Back to Blog

In a Supabase or Firebase app, the browser talks to the database directly. The only thing between a visitor and your data is the access rules: row level security policies in Supabase, security rules in Firebase. If a table has no policy, or a policy that is always true, anyone with your public key can read or change it. And the public key is in every page you serve.

Why AI-built apps get this wrong

App builders such as Lovable, Bolt, Replit and Base44, and coding agents such as Claude Code and Cursor, create tables fast and make the feature work first. A policy that blocks the app's own request makes the feature fail. The quickest fix is a policy that lets everything through. The app works, and the data is open.

What we found in 202 public apps

We collected 202 public repositories built with Lovable, Bolt, Replit, v0, Base44, Firebase Studio, Claude Code, Cursor and GitHub Copilot, and ran Vybscan's checks on them. 27 of them keep their Supabase database files in the repository, where a scan can read them. Among those 27:

What we foundApps
A table created without row level security10
A policy that lets anyone change or delete rows (always true)6
A policy that lets any signed-in user change any row6
An edge function that uses the service role key and never checks the caller5
Row level security switched off on a table4

In one app, an edge function used the admin key and let any caller make any email address a super admin. Across all 202 apps, 6 put a secret in a public environment variable, and 2 committed the Supabase service role key itself.

These are matches of the pattern, not proven exploits. A table of public counters may be open by design. But each one deserves a look, and most are a one-line fix.

What to check in Supabase

  • Every table in the public schema has enable row level security. A table without it is open to anyone holding the anon key.
  • No policy for update, delete or all is using (true) or with check (true), unless the table really is public. A policy named for the service role but with no to clause applies to everyone.
  • Policies scoped to authenticated still check ownership, for example auth.uid() = user_id. Signed in is not the same as allowed.
  • Edge functions that create a client with the service role key read the caller's token and check it before doing anything.
  • verify_jwt = false in supabase/config.toml only on functions that must be public, such as webhooks that verify their own signature.
  • The service role key never appears in the repository, or in a variable prefixed VITE_ or NEXT_PUBLIC_. The build ships those to the browser.

Supabase's Security Advisor in the dashboard lists tables without row level security in the live database. A scan of the repository catches the same mistake in the migration, before it is deployed, and again in every pull request after.

What to check in Firebase

  • Firestore and Storage rules never say allow read, write: if true; outside a sample project.
  • No test-mode rule left in place. allow read, write: if request.time < timestamp.date(...) opens everything until that date.
  • if request.auth != null on every path means every signed-in user can read and change every document. Check ownership instead: request.auth.uid == userId.
  • Realtime Database rules do not set ".write": true, or ".read": true at the root.

The Firebase emulator's rules tests are the best way to prove a rule does what you meant. A scan tells you which rules to test first.

How Vybscan checks this

Vybscan reads supabase/migrations, supabase/schemas, supabase/seed.sql, supabase/config.toml, the edge functions under supabase/functions, and the Firebase rules files firestore.rules, storage.rules and database.rules.json. It checks every pull request and push, together with the rest of the code, the dependencies and leaked keys. It follows the migrations in order, so a table that a later migration secures is not reported. It installs as a GitHub App, or connects to GitLab, with no CI to set up.

Frequently asked questions

Is the Supabase anon key a secret?

No. The anon key is meant to be public, and it ships in your front end. That is why row level security matters: the anon key plus an open table is full access. The service role key is the secret one. It skips row level security entirely, so it belongs only on a server.

Does Supabase turn on row level security by default?

Tables created in the dashboard's table editor have it on by default. Tables created in SQL, which is how migrations and most AI tools create them, do not, unless the SQL turns it on.

Can a scanner prove a policy is safe?

No. A scanner finds tables with no policy and policies that let everyone through. Whether a policy matches your intent, such as letting users see only their own team's rows, needs a test with two accounts. Vybscan flags what is open. Your tests confirm what is closed.

What does Vybscan check?

Supabase migrations, policies, edge functions and config, Firebase security rules, leaked keys, the app's own code and its dependencies, on every pull request and push. It installs as a GitHub App or connects to GitLab, with no CI to configure.

Check your Supabase or Firebase app

Connect a repository and see open tables, policies and leaked keys in a few minutes.

Try Vybscan →
← Back to Blog