Proposal: lint for RLS policies whose role lacks the table privilege (policy_without_privilege)

Aperta
#196 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@larik15 ci sta già lavorando.

Dal 5/10/2026.

  • #197 di @larik15 — aperta
  • #198 di @mattmuller — aperta
  • #200 di @mattmuller — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
1/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
postgresql, sql
Ambito
databases, testing

Direzione di ricerca

The issue describes a tested implementation, but a linked open pull request (#197) already carries the work. Review that PR for the lint, docs, tests, and expected output; the proposed lint is done when its behavior and output match the issue and the test suite passes on the stated PostgreSQL versions.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What the lint catches

A permissive RLS policy for anon or authenticated on a table in an exposed schema, where that role has no table privilege for the policy's command (SELECT/INSERT/UPDATE/DELETE). Postgres checks privileges before RLS, so the policy never takes effect and API requests fail with 42501 permission denied instead of being filtered by the policy. Proposed as an INFO-level lint, 0031_policy_without_privilege.

Why it matters now

Supabase no longer grants anon/authenticated privileges on new public tables automatically: for new projects since 2026-05-30, and for all projects on 2026-10-30 (changelog). A migration that creates a table and its policies but no GRANT now ships a policy that silently does nothing, and none of the existing lints flag a policy that has no effect because the targeted role lacks the table privilege. I searched open and closed issues and PRs in this repo and found nothing covering this.

Status

A tested implementation is ready (lint, docs, tests, expected output). The full suite passes on supabase/postgres 15.14.1.169 and 17.6.1.169. I'll open a PR linking this issue right after filing it. Happy to adjust the approach or renumber if you prefer.

Lingua principale
PLpgSQL
Stelle
284
Fork
110
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di supabase/splinter

Tutte le issue di supabase/splinter

Issue simili

Altre issue su Databases

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.