Supabase October 30, 2026 change: fix '42501 permission denied' on new tables
Published · Updated · VibeCPR
public schema are no longer reachable through the Data API (supabase-js, REST, GraphQL) until you add an explicit GRANT. Existing tables keep their grants, but a table or view that a migration drops and recreates counts as new. If your app shows 42501 permission denied for table, grant the role access, enable Row Level Security, and add policies, as one unit.What is changing on October 30, 2026?
Supabase is removing the default grants that made every new table in the public schema reachable through its Data API (the auto-generated REST and GraphQL layer that supabase-js calls). According to the official Supabase changelog:
“Once the change is rolled out to your project, new tables you create in
publicschema require an explicit opt-in (via a Postgresgrant) before the Data API can see them. Existing tables are not affected in your project, they keep their current grants and stay reachable.”
The rollout timeline from that changelog:
| Date | What happens |
|---|---|
| April 28, 2026 | Opt-in toggle at project creation |
| May 30, 2026 | New behavior becomes the default for new projects (gradual rollout) |
| September 23, 2026 | Five-week notice email to project owners and admins |
| October 23, 2026 | Final notice email |
| October 30, 2026 | New behavior enforced on existing projects (affects new tables only) |
Who is affected?
You need to act if your app talks to Supabase through supabase-js or any client library, or through /rest/v1/ or /graphql/v1, and you (or your AI tool) will create new tables after the change. Supabase specifically calls out AI coding tools, CLI scripts and Management API calls that “create tables and expect them to be reachable over the Data API on creation.”
That describes most apps built with Lovable, Bolt, v0 or Cursor: the agent writes a migration, creates a table, and wires the frontend to it in one go.
You are not affected if your app only uses a direct Postgres connection (an ORM or server with a connection string). Tables in auth, storage, realtime and custom schemas are also unaffected.
What does the error look like?
When a grant is missing, PostgREST returns this instead of data:
{
"code": "42501",
"message": "permission denied for table your_table",
"hint": "Grant the required privileges to the current role with: GRANT SELECT ON public.your_table TO anon;"
}
In the app, this usually looks like an empty list, a spinner that never ends, or a toast that says “permission denied.” It is not a bug in your code and not a Row Level Security problem: Postgres rejects the query before RLS is checked.
After Oct 30: how to tell if this is what broke your app
Use this once the change is enforced on your project (Friday, October 30, 2026 for existing projects; already in effect if your project was created from May 30, 2026 or you opted in).
The symptom. A feature that reads or writes a table created after the change stops working: the request returns 42501 permission denied for table ..., often reported as a 401 or 403. Many AI-built frontends swallow the error, so you just see an empty list or a save that does nothing. Open the browser’s Network tab and look at the /rest/v1/ response to see the real code. Tables that existed before the change keep their grants and aren’t affected.
The 30-second check. Paste this into the Supabase SQL editor (replace your_table):
-- Which Data API roles can touch this table? No row for a role = no grant.
select grantee, string_agg(privilege_type, ', ' order by privilege_type) as privileges
from information_schema.role_table_grants
where table_schema = 'public' and table_name = 'your_table'
and grantee in ('anon', 'authenticated', 'service_role')
group by grantee order by grantee;
Or check every table in public at once:
select c.relname as table_name,
c.relrowsecurity as rls_enabled,
has_table_privilege('anon', c.oid, 'select') as anon_select,
has_table_privilege('authenticated', c.oid, 'select') as authenticated_select
from pg_class c
join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public' and c.relkind in ('r', 'p')
order by authenticated_select, table_name;
The sneaky case: an “old” table breaks too. Grants belong to the table object, not its name. If a migration, ORM reset or AI agent ran drop table then create table, the result is a brand-new table with no grants, and it fails the same way. New views, and views rebuilt with drop view then create view, also start with no grants; alter table and create or replace view keep them. We tested each case on Postgres 18; the fix page has the full table and a query that lists every table and view your signed-in users can’t read.
Reading the result:
- No rows for
anonorauthenticated(or both_selectcolumns arefalse) on a table your app uses: this change is what broke it. Add the grants, RLS and policies below, in one migration. Full walkthrough: fix 42501 permission denied on a new Supabase table. - The grants are there, but you get empty results: it’s not this change. The grant exists and Row Level Security is filtering every row, usually because there’s no policy for that role yet. If writes fail with “new row violates row-level security policy”, see that fix.
- The old tables are fine and only the new one fails: expected. That’s exactly how the change works.
(We ran both queries on an embedded Postgres 18 with Supabase-style roles: a table created after revoking the default grants shows no rows and false, and select as authenticated fails with 42501 permission denied for table.)
How do I fix 42501 permission denied?
Do these three steps together. Supabase’s changelog says to “treat these three steps as a unit”:
-- 1. Grant the privileges each role needs
grant select on public.your_table to anon; -- only if logged-out visitors should read it
grant select, insert, update, delete on public.your_table to authenticated;
grant select, insert, update, delete on public.your_table to service_role;
-- 2. Enable Row Level Security
alter table public.your_table enable row level security;
-- 3. Add the policies you need
create policy "users can read their own rows"
on public.your_table
for select
to authenticated
using (auth.uid() = user_id);
The trap: don’t “fix” it by granting everything to anon
The fastest way to make the error disappear is grant all on all tables in schema public to anon. That brings back the exact exposure Supabase is trying to prevent. If any of those tables has RLS off, anyone with your public key can read it. That’s the bug behind CVE-2025-48757, where a researcher found inadequate RLS in 170 of 1,645 Lovable apps (about 10.3%), and behind the 16,326 exposed Supabase databases UpGuard reported on October 14, 2026.
Rule of thumb: grant anon only on tables a logged-out visitor should see, and never grant on a table without enabling RLS and writing a policy in the same migration.
A prompt you can paste into Cursor, Lovable or Bolt
Supabase no longer auto-grants Data API access on new public tables (enforced on existing projects Oct 30, 2026).
For every new table created in our migrations:
1. Add explicit GRANT statements: authenticated and service_role get select/insert/update/delete;
anon gets select ONLY if logged-out users must read it, otherwise no grant.
2. In the same migration: ALTER TABLE ... ENABLE ROW LEVEL SECURITY.
3. Add policies scoped to auth.uid() for user-owned rows. Never use USING (true) for write policies.
Show me the SQL before applying it.
Can I switch early to test?
If enforcement hasn’t reached your project yet, yes. The changelog gives the SQL to opt an existing project in, so you find breakage on your own schedule (try it on staging first):
alter default privileges for role postgres in schema public
revoke select, insert, update, delete on tables from anon, authenticated, service_role;
alter default privileges for role postgres in schema public
revoke usage, select on sequences from anon, authenticated, service_role;
Try this on a staging project first. The changelog also documents a rollback (re-granting default privileges), and the Supabase Security Advisor lists affected tables with remediation SQL.
Checklist: do this once, then keep it in your AI tool’s rules
- ☐ Open Security Advisor in your Supabase dashboard and review flagged tables.
- ☐ Search your migrations for
create tablewithout a matchinggrant. - ☐ Update your AI tool’s rules or system prompt to always include grant + RLS + policy.
- ☐ Make sure every table you grant to
anonhas RLS enabled and a policy you’ve read yourself. - ☐ Check your views. Supabase’s docs say views bypass RLS by default because they’re usually created by the
postgresuser. On Postgres 15+, recreate themwith (security_invoker = true). Step-by-step: fix a Supabase view that bypasses RLS. - ☐ Need the 2-minute reproduction and full fix? See Supabase 42501 permission denied on new tables.
- ☐ Separately, plan your move to the new
sb_publishable_andsb_secret_keys: Supabase’s API keys docs say the legacyanonandservice_rolekeys are being deprecated by the end of 2026.
FAQ
Will my existing app break on October 30? Not for tables that already exist. They keep their grants. Breakage happens the first time a new table is created without a grant, which can be days or weeks later when you (or your AI tool) add a feature.
My project was created after May 30, 2026. Does Oct 30 change anything for me? No. New projects have had this behavior by default since then (it rolled out gradually over a few weeks). Oct 30 is when it’s enforced on older, existing projects.
Does this replace Row Level Security? No. Grants decide whether a role can touch a table at all; RLS decides which rows it sees. You need both. If the grant is fine but writes fail, see fixing “new row violates row-level security policy”.
Why is Supabase doing this? The changelog says agents, CLI scripts and AI platforms now create tables “and many of those operations do not have a human reviewing the diff,” so access should be an explicit, reviewable decision.
Source: Supabase changelog, “Breaking Change: Tables not exposed to Data and GraphQL API automatically”. First checked October 15, 2026; re-checked October 29, 2026 (timeline unchanged).
Get Patch Notes
One email a week: breaking changes and security fixes for apps built with AI. Also puts you on the waitlist for the free Vibe Check.