Skip to content

Access control

SECURITY DEFINER function without a fixed search_pathaccess.supabase-definer-search-path

A SECURITY DEFINER function runs with its owner's privileges (usually bypassing RLS). Without `set search_path`, a caller who can create objects in a schema on the path can make it run their code with those privileges.

  • In force Rule access.supabase-definer-search-path
  • 3 clauses

At a glance

access.supabase-definer-search-path
Severitymedium
CertaintyObserved — the code as written is the problem
Looks atyour source code
When it runsRuns on every scan

How to fix it

Add `set search_path = ''` (and schema-qualify every table, e.g. `public.profiles`), or make it SECURITY INVOKER if it does not need elevated rights.

Check your own app

Run npx scanlyfix scan in your project. Every finding gets an id; after fixing, npx scanlyfix verify <id> proves it is gone.

If it is a false positive in your project, silence that one line with // scanlyfix-ignore-next-line access.supabase-definer-search-path -- <why>.

All rules

Your code stays
on your machine

Only findings are uploaded, and only to your own dashboard.