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

    1. Check the hosted project's Authentication settings in the dashboard (config.toml only sets up the local stack).
    2. Turn anonymous sign-ins off, or check (auth.jwt()->>'is_anonymous')::boolean is false in policies.
    3. Require email confirmation.
    4. Set minimum_password_length to at least 8 and enable leaked-password protection.
    5. 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 app

    References

    Related checks (M3)