Back to Checks
supabase

Supabase Auth has no test phone numbers with fixed OTP codes

auth_sms_test_otp_not_configured
Service: authSeverity: high
OfficialVerifiedPrivate
Categories:identity-accesssecrets
Resource Type:SupabaseAuthConfig

Checks that Supabase Auth has no test phone numbers with fixed OTP codes configured, as the Supabase production checklist requires.

Prowler logoProwlerprowler-provider-supabase

Risk

A test phone number accepts its fixed OTP code without an SMS. Anyone who learns the code can sign in as that phone number's user.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler supabase --checks auth_sms_test_otp_not_configured

Recommendation

Remove test phone numbers and OTP codes from production projects.

Remediation

Other

1In the Supabase dashboard, open Authentication > Sign In / Providers > Phone
2Remove every entry under Test Phone Numbers and OTPs
3Save

Check Code

from prowler.lib.check.models import Check

from prowler_provider_supabase.check_report import CheckReportSupabase
from prowler_provider_supabase.services.auth.auth_client import auth_client


class auth_sms_test_otp_not_configured(Check):
    def execute(self) -> list[CheckReportSupabase]:
        findings = []
        for config in auth_client.auth_configs:
            if not config.has("sms_test_otp"):
                continue
            report = CheckReportSupabase(metadata=self.metadata(), resource=config)
            # Never put the value in the finding: the codes sign users in.
            if not config.sms_test_otp:
                report.status = "PASS"
                report.status_extended = f"Project {config.name} has no test phone numbers with fixed OTP codes."
            else:
                report.status = "FAIL"
                report.status_extended = f"Project {config.name} has test phone numbers with fixed OTP codes."
            findings.append(report)
        return findings