mckaywrigley / chatbot-ui

AI chat for every model.
https://chatbotui.com
MIT License
27.37k stars 7.59k forks source link

Read supabase_service_role_key from environment #1758

Open Chr96er opened 1 month ago

Chr96er commented 1 month ago

The README tells users: Service role key: Found in "Project API keys" as "service_role" (Reminder: Treat this like a password!)

However, the setup of supabase/migrations/20240108234540_setup.sql takes the Service role key as a hard-coded string and even the default value is provided, which is bound to mislead some users into thinking that this is not a credential. I have looked into 5 forks of the repo and in two cases the service role key was leaked into their publicly available forks. In other cases, users changed the line to read the key from the environment, e.g. service_role_key TEXT := getenv('SUPABASE_SERVICE_ROLE_KEY');

Please implement this as soon as possible, if you value your user's security.

gianlucagilardi commented 1 month ago

Bumped into this problem just today with a new deploy; best mitigation I found was to fork, then import the fork in a bitbucket private repo and move from there