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

Abierto
#196 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@larik15 ya está trabajando en esto.

Desde el 5/10/2026.

  • #197 de @larik15 — abierto
  • #198 de @mattmuller — abierto
  • #200 de @mattmuller — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
1/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
postgresql, sql

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
PLpgSQL
Estrellas
284
Forks
110
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de supabase/splinter

Todos los issues de supabase/splinter

Issues similares

Más issues de Databases

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.