Skip to content

feat: add default_privileges_expose_new_tables lint (0033) - #216

Open
mateuszingano wants to merge 1 commit into
supabase:mainfrom
mateuszingano:feat/default-privileges-lint
Open

mateuszingano wants to merge 1 commit into
supabase:mainfrom
mateuszingano:feat/default-privileges-lint

Conversation

@mateuszingano

@mateuszingano mateuszingano commented Nov 17, 2026 •

Copy link
Copy Markdown

after oct 30 new tables need an explicit grant, and the quick fix a lot of people reach for when they hit the first 42501 is just putting the old default back:

alter default privileges in schema public
  grant select, insert, update, delete on tables to anon, authenticated;

that makes the error go away, but every table created after that is exposed again on creation, rls or not. no current lint catches it because nothing is exposed yet at the moment the default is added.

this one flags table defaults in pg_default_acl that grant to anon, authenticated or PUBLIC, in a schema from pgrst.db_schemas (or with no in schema). it skips defaults owned by supabase_/pg_ roles since the project owner can't change those, and service_role-only defaults.

a couple of notes:

@mateuszingano
mateuszingano requested a review from a team as a code owner November 17, 2026 18:44
@mateuszingano
mateuszingano force-pushed the feat/default-privileges-lint branch from ab11458 to 81f99be Compare November 17, 2026 18:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant