Is your Supabase Storage bucket public? How to check and lock it down
Public vs private Supabase Storage buckets, the storage.objects policies that control uploads and downloads, and signed URLs for private files.
Check your live site
Run the free ShipLatch scan on your own site without leaving this page.
Uses 1 of your 3 free scans today; a site scanned in the last 24 hours answers from that scan. Passive and read-only: we only look at what any browser can see. Only check sites you own or may test.
What the free scan checks
- Leaked keys in your live JavaScript (AI, payment and cloud keys), including a Supabase
service_rolekey - Files that should never be public, like
/.envand/.git - Supabase and Firebase secrets in the browser: an
sb_secret_key, a Supabase access token or a Firebase service-account file - HTTPS and security headers (CSP, HSTS, clickjacking protection)
It only reads what any visitor's browser can see. It doesn't log in, read your tables or check App Check.
Supabase Storage has two kinds of buckets. A public bucket serves every file to anyone who has (or guesses) its URL, without checking who is asking. A private bucket only serves files to requests your policies allow. AI builders often create buckets as public because it makes images "just work", which is fine for avatars and logos and bad for invoices, ID photos or user uploads.
How to check
- In the Supabase dashboard open Storage and look at each bucket. Public buckets are labelled as public.
- For each public bucket, ask: would I be okay if a stranger downloaded every file in here? If not, it should be private.
- Open Storage → Policies and check the policies on
storage.objects. A policy that allowsinsertforanonmeans strangers can upload to your project.
Fix
Make the bucket private, then allow each signed-in user to read and write only their own folder (files stored as <user id>/filename):
create policy "read own files" on storage.objects for select to authenticated using (bucket_id = 'uploads' and (storage.foldername(name))[1] = auth.uid()::text); create policy "upload own files" on storage.objects for insert to authenticated with check (bucket_id = 'uploads' and (storage.foldername(name))[1] = auth.uid()::text);
To show a private file in your app, create a short-lived signed URL (createSignedUrl in supabase-js) instead of using a public URL.
Audit my Supabase Storage setup. List every bucket and whether it is public. Make any bucket that holds user uploads or private documents private. Store each user's files under a folder named with their auth user id, and add storage.objects RLS policies so authenticated users can only select, insert, update and delete files in their own folder. Replace public URLs for private files with createSignedUrl links that expire. Don't allow anon uploads.
Related: Enable Supabase RLS · Supabase anon key explained
Scan your app free
Paste your URL. ShipLatch checks for leaked keys, exposed /.env and /.git, and flags Supabase/Firebase so you know what to lock down. The free scan finds the issues; the $29 Fix Pack gives you fix prompts written for your app and re-scans that prove each fix worked.
Want the whole pre-launch process in one place? See what's inside App Security for Vibe Coders, our $9 PDF playbook, or go straight to checkout.