Skip to content
WebCureby Swasti
Critical

Database open to everyone

Supabase or Firebase tables any logged-in (or anonymous) user can read and edit.

What it is

Backend-as-a-service databases are called straight from the browser. Without Row Level Security (Supabase) or strict security rules (Firebase), the public anon key can read or change every row in a table.

Why fast-built apps get it

RLS is off by default on new Supabase tables created with SQL, and test-mode Firebase rules allow everything. Generated code works perfectly in the demo, so nobody notices.

Before and after the cure

supabase/migrations/001_profiles.sqlVulnerable
create table profiles (
  id uuid primary key,
  email text,
  plan text,
  is_admin boolean default false
);
-- No RLS: the public anon key can select and update every row
supabase/migrations/002_profiles_rls.sqlCured
alter table profiles enable row level security;

create policy "Users read their own profile"
  on profiles for select using (auth.uid() = id);

create policy "Users update their own profile"
  on profiles for update using (auth.uid() = id)
  with check (is_admin = false);  -- can't promote themselves

What it can cost you

  • One user downloads every other user's data
  • Anyone can change prices, plans or roles in your tables
  • A single curl command can wipe a table

Check your own app

  • In Supabase, check every table shows “RLS enabled” with policies
  • In Firebase, look for rules like “allow read, write: if true”
  • Try fetching another user's row with your own logged-in session

The cure

  • Enable RLS on every table and write policies per action
  • Keep sensitive columns (role, plan, credits) writable only from the server
  • Add a test that fails if a new table ships without RLS

Does your app have this one?

We'll check this and every other loophole on your app, then give you the cure.

Talk to us on WhatsApp