high · M3 · MASVS-AUTH-2 · PTKD-BACKEND-SUPABASE-BLANKET-GRANT
Blanket GRANT to the anon role on the whole public schema
A migration grants table privileges to anon (or public) on all tables in the public schema, or sets default privileges so every future table is granted on creation. Since Supabase stopped auto-granting new tables (30 October 2026) this is the usual quick fix, and it exposes every table, including ones created later before anyone writes RLS for them.
How it is exploited
After the October 2026 change, a new table returned 42501 permission denied, and the fix was `grant all on all tables in schema public to anon`. A month later an audit_log table without RLS is added; it is readable and writable with the anon key from the first deploy.
Why it matters
Every table without RLS, now or later, is open to anyone with the app's anon key.
How to fix it
- Replace the blanket grant with per-table grants for what the app needs.
- Drop ALTER DEFAULT PRIVILEGES grants to anon.
- Keep RLS on every public table.
Does your app have this?
PTKD checks your build or your source project for PTKD-BACKEND-SUPABASE-BLANKET-GRANT and every other check in this knowledge base.
Scan your appReferences
Related checks (M3)
- Permissive CORS with credentials
- State-changing request succeeded without authentication
- Weak JWT observed on the wire
- Biometric authentication not bound to a cryptographic key
- Premium access is stored on the phone and trusted (heuristic)
- Firebase rules trust an email address nobody verified
- Firebase security rules open to everyone
- Users can make themselves admin or premium in Firestore