Back to Checks
Supabase auth users are not exposed through a view or materialized view
database_auth_users_not_exposed
Service: databaseSeverity: critical
OfficialVerifiedPrivate
Categories:internet-exposed
Resource Type:SupabaseDatabaseObject
Reports views or materialized views in exposed schemas that reference auth.users and are reachable by the anon or authenticated roles, as found by the Security Advisor (lint auth_users_exposed).
Risk
A view over auth.users exposed through the Data API can leak every user's email, phone number and metadata to anyone holding the public API key.
Run this check with Prowler
Run in Prowler CloudInstall
pip install --extra-index-url https://__token__:${PROWLER_REGISTRY_DOWNLOAD_API_KEY}@registry.prowler.com/simple/ "prowler-provider-supabase[runtime]"Run
prowler supabase --checks database_auth_users_not_exposedRecommendation
Move the view to a schema the Data API does not expose, or revoke access from the anon and authenticated roles.
Remediation
Other
1In the Supabase dashboard, open the project
2Go to Advisors > Security Advisor
3Open the issue and follow its remediation
4Rerun the advisor to confirm the issue is gone
Check Code
from prowler.lib.check.models import Check
from prowler_provider_supabase.check_report import CheckReportSupabase
from prowler_provider_supabase.services.database.database_client import database_client
from prowler_provider_supabase.services.database.database_security_advisor import (
security_lint_findings,
)
class database_auth_users_not_exposed(Check):
def execute(self) -> list[CheckReportSupabase]:
return security_lint_findings(self, database_client)