AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Supabase Hardening Docs ALTER DEFAULT PRIVILEGES Revoke Execute On Functions From PUBLIC Has No Effect Due IN SCHEMA

The fourth ALTER DEFAULT PRIVILEGES statement in the Supabase 'Securing your API' docs uses IN SCHEMA public to revoke EXECUTE on functions from PUBLIC, but schema-qualified default ACLs merge with PostgreSQL's built-in default instead of replacing it, so new functions remain callable by anon.

highConfidence 95%Supabasepgvectorsupabase-jsEdge Functions

Origin Analysis

PostgreSQL's ALTER DEFAULT PRIVILEGES ... IN SCHEMA merges with the built-in default ACL rather than replacing it. The built-in default grants EXECUTE on functions to PUBLIC, and a schema-scoped revoke cannot subtract that grant. The schema-less form replaces the built-in default, so the revoke from PUBLIC takes effect.
Run the four statements from the docs verbatim, then create public.after_docs() and public.after_docs_t table; query has_function_privilege('anon', oid, 'EXECUTE') returns true for the function but has_table_privilege('anon', oid, 'SELECT') returns false for the table.

Fixing Code Block

Edge Case Audit

This change affects only future functions created by role postgres. Existing functions remain callable until you explicitly revoke execute from PUBLIC/anon/authenticated/service_role on those functions. Revoking from PUBLIC can break intentionally public functions; test and roll back with 'alter default privileges for role postgres grant execute on functions to public;'. Functions created by other roles (e.g., anon, authenticated) need separate default privilege changes. Apply in a transaction if possible.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state