You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Six views are defined with SECURITY DEFINER. They run with the view owner's privileges and RLS context instead of the invoker's, which can bypass row-level security and lead to privilege escalation or unintended data exposure.
Affected objects
core.v_id_verification_latest
public.v_active_cron_jobs
core.v_team_daily_metrics_latest
core.v_team_member_workloads_latest
core.v_profile_search
core.v_news_feed_health
Remediation
For each view, decide whether it must run as definer (e.g. for cross-schema access). If not, recreate the view with SECURITY INVOKER (default in newer Postgres).
If definer is required, ensure the view definition and underlying objects are locked down and that only intended callers can use it.
Migration added:403_security_invoker_views.sql sets security_invoker = on for five views so they run with the caller's privileges and RLS context:
core.v_id_verification_latest
core.v_team_daily_metrics_latest
core.v_team_member_workloads_latest
core.v_profile_search
core.v_news_feed_health
Left as SECURITY DEFINER:public.v_active_cron_jobs — it reads from cron.job (pg_cron); only the definer can read that catalog. Documented in the migration.
Activity
thinkclay commentedon Mar 10, 2026
Implemented (Phase 2 of security hardening):
403_security_invoker_views.sqlsetssecurity_invoker = onfor five views so they run with the caller's privileges and RLS context:core.v_id_verification_latestcore.v_team_daily_metrics_latestcore.v_team_member_workloads_latestcore.v_profile_searchcore.v_news_feed_healthpublic.v_active_cron_jobs— it reads fromcron.job(pg_cron); only the definer can read that catalog. Documented in the migration.pnpm supa:generaterun.Callers of the five views must now have appropriate privileges on the underlying tables; RLS is enforced for the invoking role.