supabase / supabase-js

An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
https://supabase.com
MIT License
2.83k stars 219 forks source link

`supabase` client exposes schema details via hint and messages #1009

Open bombillazo opened 3 weeks ago

bombillazo commented 3 weeks ago

Bug report

Describe the bug

In our app, we manage everything with the service role from the backend. We've updated our database role privileges and grants so that the anon and authenticated roles cannot access the public and storage schemas since Supabase hardcodes these schemas as enabled in the client.

image

We use the client in our frontend app for authentication purposes using the anon_key. However, we noticed that even with the privileges revoked, even non-authenticated users could snoop using the different superbase client functions like select and rpc.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Use the supabase client
  2. Revoke access, privileges and grants from anon/authenticated DB roles
  3. Use any of the supabase client functions that query a table or call an RPC
  4. See response messages and hints

Expected behavior

We don't want any details leakage in our API, and the Supabase client unfortunately acts as a vector to snoop around with the anon key for API details.

Screenshots

image image image image

System information