For the SECURITY DEFINER query, listing them isn't quite the test. What matters is has_function_privilege('anon', fn, 'execute'). On PG17, revoke execute ... from anon still left it true and anon read the secrets table, because EXECUTE is granted to PUBLIC by default. Only revoking from public turned it false.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
Listing them only says they exist, it doesn't say anon can run one — the privilege check is the real test. The PUBLIC default is the nasty bit, revoke from anon looking like it worked while nothing changed. Going to run the privilege version against the same dummy schema and see if revoke-from-public is what actually closes it. Was that a real Supabase project or a local PG17?
Local PG17, not a real project. One thing to watch on Supabase though: as far as I know the public schema there has default privileges that grant execute on new functions straight to anon, so it's not only via PUBLIC. I mimicked that locally and revoke from public alone left has_function_privilege true for anon. Only after revoking from anon as well did it go false, so I'd do both.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
Local PG17 makes it cleaner, no real project to worry about breaking. The Supabase default-privilege bit is the part I missed. Revoke from public alone still leaves anon with execute, so the run has to test both revokes side by side. Going to run it that way. Is that default privilege written down anywhere on Supabase's side, or just something you found by poking at it?
Half and half. Supabase's Database Functions guide has a "Function privileges" section that says any role can run a function by default and tells you to revoke from both public and the role you're restricting, same for default privileges on future functions: supabase.com/docs/guides/database/...
The anon grant on its own is what I saw poking at it, the docs only imply it by telling you to revoke from both. So I'd still check has_function_privilege('anon', ...) on the real project after the revoke rather than trust either of us.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
Half and half is the honest answer then, the docs tell you to revoke from both without ever saying the anon grant is there on its own. The check after the revoke stays in the run either way.
We check MCP servers and websites from the outside, the way an AI agent sees them, and publish what we find with names and dates. Free tools at x1y1.co/tools.
The MCP baseline half deserves its own post. Cursor's MCPoison bug (CVE-2025-54136) was exactly that case: an approved server entry whose command was swapped later, with no new prompt. A diff against a saved tool list would have caught it.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
That's exactly the case the second half was built for and never got to show. The script in the piece catches an added tool and a widened input, but a swapped command on an approved entry is the sharper test, and MCPoison is the real version of it. I'll run that one, same baseline script, one entry whose command changes after approval, and see the diff catch it. Have you seen the same pattern anywhere outside Cursor, or is that the one example?
We check MCP servers and websites from the outside, the way an AI agent sees them, and publish what we find with names and dates. Free tools at x1y1.co/tools.
Same idea one layer down: Invariant Labs called it a rug pull in their April 2025 tool poisoning write-up. The server changes its tool descriptions after you approved it. Your baseline diff on tools/list would catch that one too.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
That's the case the baseline half was built for, a description swap after approval is exactly what a diff on tools/list would catch. Going to run the swap against the same baseline script. Did the write-up say whether it was a one-off swap or the descriptions kept drifting?
This is a useful checklist, and being upfront that the RLS audit was not run on a live Supabase project yet makes it more trustworthy, not less. One addition I would suggest: after the catalogue queries, test as the anon role itself with a real request against a table that should be locked. Policies can read correctly in the catalogue and still behave differently in practice, especially with the default-privilege issue Sunnatulla raised. And I agree with X1Y1 that the MCP baseline half deserves its own post — a saved tool list that diffs on every run would catch exactly the kind of silent swap that worries me most.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
The anon-role test is the part the piece missed — a policy can read right in the catalogue and still let anon through in practice. Going to run that against a locked table and see what actually comes back. And yeah, the MCP baseline half is getting its own post, you and X1Y1 both pointed at the same gap.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
For the SECURITY DEFINER query, listing them isn't quite the test. What matters is
has_function_privilege('anon', fn, 'execute'). On PG17,revoke execute ... from anonstill left it true and anon read the secrets table, because EXECUTE is granted to PUBLIC by default. Only revoking from public turned it false.Listing them only says they exist, it doesn't say anon can run one — the privilege check is the real test. The PUBLIC default is the nasty bit, revoke from anon looking like it worked while nothing changed. Going to run the privilege version against the same dummy schema and see if revoke-from-public is what actually closes it. Was that a real Supabase project or a local PG17?
Local PG17, not a real project. One thing to watch on Supabase though: as far as I know the public schema there has default privileges that grant execute on new functions straight to anon, so it's not only via PUBLIC. I mimicked that locally and revoke from public alone left has_function_privilege true for anon. Only after revoking from anon as well did it go false, so I'd do both.
Local PG17 makes it cleaner, no real project to worry about breaking. The Supabase default-privilege bit is the part I missed. Revoke from public alone still leaves anon with execute, so the run has to test both revokes side by side. Going to run it that way. Is that default privilege written down anywhere on Supabase's side, or just something you found by poking at it?
Half and half. Supabase's Database Functions guide has a "Function privileges" section that says any role can run a function by default and tells you to revoke from both public and the role you're restricting, same for default privileges on future functions: supabase.com/docs/guides/database/...
The anon grant on its own is what I saw poking at it, the docs only imply it by telling you to revoke from both. So I'd still check has_function_privilege('anon', ...) on the real project after the revoke rather than trust either of us.
Half and half is the honest answer then, the docs tell you to revoke from both without ever saying the anon grant is there on its own. The check after the revoke stays in the run either way.
The MCP baseline half deserves its own post. Cursor's MCPoison bug (CVE-2025-54136) was exactly that case: an approved server entry whose command was swapped later, with no new prompt. A diff against a saved tool list would have caught it.
That's exactly the case the second half was built for and never got to show. The script in the piece catches an added tool and a widened input, but a swapped command on an approved entry is the sharper test, and MCPoison is the real version of it. I'll run that one, same baseline script, one entry whose command changes after approval, and see the diff catch it. Have you seen the same pattern anywhere outside Cursor, or is that the one example?
Same idea one layer down: Invariant Labs called it a rug pull in their April 2025 tool poisoning write-up. The server changes its tool descriptions after you approved it. Your baseline diff on tools/list would catch that one too.
That's the case the baseline half was built for, a description swap after approval is exactly what a diff on tools/list would catch. Going to run the swap against the same baseline script. Did the write-up say whether it was a one-off swap or the descriptions kept drifting?
This is a useful checklist, and being upfront that the RLS audit was not run on a live Supabase project yet makes it more trustworthy, not less. One addition I would suggest: after the catalogue queries, test as the anon role itself with a real request against a table that should be locked. Policies can read correctly in the catalogue and still behave differently in practice, especially with the default-privilege issue Sunnatulla raised. And I agree with X1Y1 that the MCP baseline half deserves its own post — a saved tool list that diffs on every run would catch exactly the kind of silent swap that worries me most.
The anon-role test is the part the piece missed — a policy can read right in the catalogue and still let anon through in practice. Going to run that against a locked table and see what actually comes back. And yeah, the MCP baseline half is getting its own post, you and X1Y1 both pointed at the same gap.
I would run those eight read-only queries before I trust any AI-built app with my data.
That's the order that matters — run them before you trust it, not after something goes wrong. Have you got an app in mind to try them on?