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
{{ message }}
Repository navigation
Set explicit search_path on database functions #172
The linter reported many functions that do not set an explicit search_path. Relying on the session's search_path can make behavior depend on the caller and open the door to search_path-based attacks. Setting search_path on each function (e.g. to the function's schema) fixes this.
Affected objects
Run Supabase MCP get_advisors with type: "security" and filter by function_search_path_mutable. Affected schemas: core, data, forsured, onet, public (many functions in each).
Remediation
For each function, add a fixed search_path (e.g. SET search_path = core) in the function definition.
Example: CREATE OR REPLACE FUNCTION core.foo() RETURNS ... SET search_path = core AS $$ ... $$;
Migration added:404_function_search_path.sql sets an explicit search_path on all application-owned functions in schemas core, data, forsured, onet, and public. Each function gets search_path set to its own schema. Only functions owned by the migration runner (current_user) are altered, so extension/system functions (e.g. public.regexp_split_to_table) are skipped.
Activity
thinkclay commentedon Mar 10, 2026
Implemented (Phase 3 of security hardening):
404_function_search_path.sqlsets an explicitsearch_pathon all application-owned functions in schemascore,data,forsured,onet, andpublic. Each function getssearch_pathset to its own schema. Only functions owned by the migration runner (current_user) are altered, so extension/system functions (e.g.public.regexp_split_to_table) are skipped.pnpm supa:generaterun.fix(db): repair search_path clobbered by migration 308 (#448)