Back to Checks
Supabase view runs with the permissions of the querying user
database_view_security_invoker_enabled
Service: databaseSeverity: high
OfficialVerifiedPrivate
Categories:privilege-escalation
Resource Type:SupabaseDatabaseObject
Reports views defined with SECURITY DEFINER semantics, which run with the permissions of the view's owner instead of the querying user, as found by the Security Advisor (lint security_definer_view).
Risk
A security definer view bypasses the RLS policies of the tables it reads. Users can read through the view rows that the tables' policies would deny them.
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_view_security_invoker_enabledRecommendation
Recreate the view with security_invoker = true (Postgres 15 and above), or move it out of the exposed schemas.
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_view_security_invoker_enabled(Check):
def execute(self) -> list[CheckReportSupabase]:
return security_lint_findings(self, database_client)