low · M3 · MASVS-AUTH-2 · PTKD-BACKEND-SUPABASE-RLS-NO-POLICY
Supabase table with RLS on but no policy at all
Row Level Security is enabled on a public table, but no migration creates a policy for it. The table is closed to the app's users (every query returns nothing), which usually means the app reaches it some other way: with the service_role key, or through a view or SECURITY DEFINER function. Those paths skip RLS.
How it is exploited
The table was locked down with RLS but no policies, the app 'broke', and the quick fix was to call it with the service_role key from the app. That key now ships in the build and opens every table.
Why it matters
On its own the data is safe but unusable; the usual workaround (service key, definer view) removes all protection.
How to fix it
- List what the app needs from the table per operation.
- Write one policy per operation tied to the signed-in user.
- Remove any service_role key from the app and rotate it.
Does your app have this?
PTKD checks your build or your source project for PTKD-BACKEND-SUPABASE-RLS-NO-POLICY 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