Description

Ensure the Allow anonymous sign-ins setting is disabled unless the application has a clear, documented need for anonymous users, such as guest shopping carts. If it is enabled, RLS policies must check the is_anonymous claim to limit what anonymous users can do.

Rationale

Anonymous users are given the authenticated role, the same as real signed-in users. Existing RLS policies written for authenticated users will therefore also apply to anonymous users, who may gain access to data or actions they should not have. Anonymous sign-ins can also be abused to create large numbers of accounts and increase costs.

Impact

  • Prevents unintended access by anonymous users

  • Reduces abuse through mass account creation

  • Guest features that rely on anonymous users will stop working

Default Value

By default, anonymous sign-ins are disabled.

Pre-Requisites

  • Project Owner or Admin role

Test Plan

  1. Sign in to the Supabase Dashboard at https://supabase.com/dashboard.

  2. Select your project.

  3. Open Authentication in the sidebar and select Sign In / Providers.

  4. Verify that Allow anonymous sign-ins is disabled.

  5. If it is enabled without a documented need, follow the implementation steps.

Implementation Steps

  1. Sign in to the Supabase Dashboard at https://supabase.com/dashboard.

  2. Select your project.

  3. Open Authentication in the sidebar and select Sign In / Providers.

  4. Disable Allow anonymous sign-ins.

  5. Select Save.

Backout Plan

  1. Sign in to the Supabase Dashboard at https://supabase.com/dashboard.

  2. Select your project.

  3. Open Authentication in the sidebar and select Sign In / Providers.

  4. Enable Allow anonymous sign-ins.

  5. Select Save.

Reference