Back to Checks
supabase

Supabase foreign table is not exposed through the Data API

database_foreign_table_not_exposed
Service: databaseSeverity: medium
OfficialVerifiedPrivate
Categories:internet-exposed
Resource Type:SupabaseDatabaseObject

Reports foreign tables that the anon or authenticated roles can reach through the Data API, as found by the Security Advisor (lint foreign_table_in_api).

Risk

Foreign tables do not support RLS. One exposed through the Data API returns the remote data to anyone holding the public API key.

Run this check with Prowler

Run in Prowler Cloud
Install
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_foreign_table_not_exposed

Recommendation

Move the foreign table 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_foreign_table_not_exposed(Check):
    def execute(self) -> list[CheckReportSupabase]:
        return security_lint_findings(self, database_client)