ShipShape

Guide

Can your users make themselves admin?

Row level security decides which rows a signed-in user can write. It does not decide which columns. If role, is_admin, plan, or credits sits on a row they are allowed to update, they can raise their own privileges from the browser console. ShipShape’s passive scan cannot see policies or column grants. This is a check you run yourself.

Where these statements come from

Checked on 24 November 2026. The SQL below is the statement Supabase publishes, or the same statement with the table and columns named. Sources: Column level security, Row Level Security, and Managing user data. The leaking-policy guide covers using (true) and user_metadata. This page is the update policy that is scoped to the user’s own row and still lets them change a privilege column.

The policy checks the row

Supabase’s row level security guide uses this update policy so a signed-in user can edit their own profile. The using expression chooses the existing row. The with check expression stops them from handing the row to someone else. Both compare auth.uid() to the owner column.

create policy "Users can update their own profile."
on profiles for update
to authenticated
using ( (select auth.uid()) = user_id )
with check ( (select auth.uid()) = user_id );

That is the right shape for a display name. It is the wrong shape, on its own, for a privilege. Supabase’s column-level security guide says this kind of policy gives the owner full access to update the row, including all of the columns. Postgres then applies grants. A table-level UPDATE grant means every column. role, is_admin, plan, and credits are columns. The policy does not leave them out.

Revoke table update, then grant the safe columns

Supabase’s column-level security guide says a table-level privilege still applies if you only revoke a column privilege. Revoke update on the table first, then grant update on the columns the user may edit. Their published example is a posts table:

revoke update on table public.posts from authenticated;

grant update (title, content) on table public.posts to authenticated;

The same two statements on a profiles table, with display_name and avatar_url standing in for columns a signed-in user is allowed to change. Leave role, is_admin, plan, and credits off that list. The revoke also names anon, the role for a request with no user session. The published posts example names authenticated only. Add anon when that role can update the table. A later grant update on table puts every column back in reach.

revoke update on table public.profiles from anon, authenticated;

grant update (display_name, avatar_url) on table public.profiles to authenticated;

The same page says restricted roles cannot use select * on the affected table. Name the columns. It also says column privileges are an advanced tool, and that for most apps it recommends row level security plus a dedicated table for roles.

Better: a table the user cannot write

Keep role, plan, and credits on a table the signed-in user cannot update. The server writes it, or a Stripe webhook writes it, using the secret key. That key bypasses row level security, which is why it stays off the client. The env variable guide is the line between the anon key and that secret.

Supabase’s row level security guide starts a profiles table with revoke all on table profiles from anon, authenticated, then grants back only the operations the API should perform. For a roles table, stop before granting update. Enable row level security. A select policy can let a user read their own role. Do not add an update policy.

revoke all on table public.user_roles from anon, authenticated;

Do not read the role from user_metadata

Moving the column is not enough if the policy then trusts user_metadata. Supabase’s row level security guide says raw_user_meta_data can be updated by the authenticated user, and that it is not a place to store authorization data. The user can set it from the client with updateUser({ data: { is_admin: true } }). app_metadata is the claim the user cannot edit, and the JWT stays stale until it refreshes. The leaking-policy guide has the policy to refuse and the app_metadata example. Never base access on user_metadata.

Sign in as a normal user and try it

This is a check you run. The SQL editor connected as postgres bypasses row level security, so a successful update there proves nothing about the policy. Sign in to the app as a normal user, not as an admin, and run the update from the browser console against the client the page already created. Replace profiles and role with your table and column.

const { data, error } = await supabase
  .from("profiles")
  .update({ role: "admin" })
  .eq("id", (await supabase.auth.getUser()).data.user.id)
  .select("id, role");

The column grant held when error is set and the row’s role did not change. The grant did not hold when data comes back with role set to admin. Then sign in as a second user and try to update the first user’s id. That call should change nothing. The own-row policy is what the second call checks. The column grant is what the first call checks.

If the page is using the service_role key, the update can succeed for a different reason: that key bypasses row level security. It does not belong in the browser. ShipShape can report that key when it is in the public page or a same-origin script. It still does not see the policy.

What the free check cannot see

ShipShape fetches the public page, the same-origin scripts, seven fixed paths, and source maps those scripts name. It does not query tables and it does not test row level security. It cannot see policies or column grants. A grade of A does not mean a user cannot update role.

The free check is for what that URL already sends a visitor. Run it after you publish. This page is the check you run in the database. Monitor, €9 per month, repeats the same passive check each week and when a deploy hook fires. It will not notice this policy.

Questions

Can a signed-in user change their own role if they can update their own row?

Yes, when role, is_admin, plan, or credits is a column on that row and the role has a table-level update grant. The policy decides which row they may write. It does not decide which columns. Revoke update on the table from authenticated, then grant update only on the columns they should edit.

Does row level security limit columns?

No. Supabase’s column-level security guide says row level security controls rows, and column privileges control columns. A policy of using (auth.uid()) = user_id still lets the owner update every column the role can update.

Is user_metadata a safe place for is_admin?

No. Supabase’s row level security guide says raw_user_meta_data can be updated by the authenticated user, and that it is not a place to store authorization data. A policy that reads user_metadata for a role trusts a value the user can change.

Can ShipShape see this policy or these grants?

No. The free check does not query tables and does not test row level security. It cannot see policies or column grants. Sign in as a normal user and try to update role yourself.

Run a free check