medium · M3 · MASVS-AUTH-1 · PTKD-BACKEND-SUPABASE-AUTH-CONFIG
Supabase auth settings in the local config (check the hosted project)
supabase/config.toml, which configures the local Supabase stack, has Auth settings that make account abuse easy: anonymous sign-ins on, sign-ups without email confirmation, or a short minimum password length. The hosted project may differ: its settings are in the dashboard.
How it is exploited
With anonymous sign-ins on and policies written `to authenticated`, a script creates thousands of anonymous sessions, each one passing every 'signed-in users only' policy.
Why it matters
Fake accounts at scale, spam, and data reached through policies that assumed a real user.
How to fix it
- Check the hosted project's Authentication settings in the dashboard (config.toml only sets up the local stack).
- Turn anonymous sign-ins off, or check (auth.jwt()->>'is_anonymous')::boolean is false in policies.
- Require email confirmation.
- Set minimum_password_length to at least 8 and enable leaked-password protection.
- Add CAPTCHA to sign-up and sign-in.
Does your app have this?
PTKD checks your build or your source project for PTKD-BACKEND-SUPABASE-AUTH-CONFIG 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