Glossary
Security definer
A database function that runs with its author's permissions rather than the caller's.
What it means
A security definer function runs as whoever created it, not whoever calls it. That is useful and sometimes necessary: a function can check a role without the caller needing permission to read the roles table, which avoids rules that reference themselves in a loop.
It is also a hole with a handle on it. Any function marked this way is a path around your row rules, and if it takes an argument that decides which rows it returns, the caller now chooses what to read with the author's permissions.
The safe pattern is narrow: no arguments that select rows, a fixed search path, and execute permission granted only to the roles that need it. It is invisible from outside, so it belongs to code review.
Incidents where it mattered
No incident in the library maps to this one yet.
ShipReady is not a penetration test or a security certification. No automated check can prove an application is secure.
Last updated September 20, 2026
