RattleCheck GitHub

Supabase column permissions

Who can read the
private email?

Anyone can browse this directory. Each listing has a public name and a private email. Here’s what changes when the migration grants access to specific columns.

What a signed-out visitor can read
ColumnBeforeAfter
idReadableReadable
display_nameReadableReadable
private_emailReadableBlocked

Table-wide grant

Grade C

RC006 · high · Signed-out visitors have permission to read public.directory.private_email on any row visible to them.

Inspect the SQL

001_directory.sql

create table public.directory (
  id integer primary key,
  display_name text not null,
  private_email text not null
);
alter table public.directory enable row level security;
create policy browse on public.directory for select to anon using (true);
grant select on public.directory to anon;

Column grant

Grade B

RC006 cleared. The narrowed grant keeps the private email out of signed-out reads.

Inspect the SQL

002_narrow_reads.sql

revoke select on public.directory from public, anon;
grant select (id, display_name) on public.directory to anon;

Both scans include the RC005 warning because the directory deliberately allows public reads of every row.

Check your own migrations

Run from your Supabase repo root with Node.js 20 or newer. The scan reads local SQL files and needs no database credentials.

Add the check to your GitHub pull requests

npx rattlecheck@latest