Guide · Supabase Storage · Updated
Is My Supabase Storage Bucket Public? How to Check Who Can See Your Users' Files
If your app lets people upload files, those files live in Supabase Storage buckets. A bucket can be public or private. Pick wrong and a stranger can open your users' ID photos, invoices or private pictures just by having the link. Here is how buckets work, a test you can run in 2 minutes while signed out, and prompts to fix it.
1. Public vs private buckets
Supabase says buckets are private by default. In a private bucket, every action, including downloads, goes through your Row Level Security (RLS) policies. To show a private file, your app either downloads it as the signed-in user or makes a signed URL that only works for a short time.
A public bucket skips those checks for reading files. Anyone who has a file's URL can open it. Public file links look like this:
https://YOUR-PROJECT.supabase.co/storage/v1/object/public/BUCKET/path/to/file.jpg
That is fine for profile pictures, product photos and blog images. It is not fine for anything a user would not post online. File names are often easy to guess (like a user id plus avatar.png), and links get shared, logged and indexed.
Source: Supabase: Storage buckets
2. What storage policies control
Storage access rules are RLS policies on the storage.objects table. Supabase says Storage allows no uploads until you add policies. Even in a public bucket, uploading, deleting, moving and copying are still controlled by these policies.
A safe setup for user uploads usually means each user has a folder named after their user id, and each policy checks both the bucket and the folder:
create policy "Users upload to their own folder"
on storage.objects for insert to authenticated
with check (
bucket_id = 'uploads' and
(storage.foldername(name))[1] = (select auth.uid())::text
);Supabase's own example policies start from with check (true) and then narrow it down. If your AI builder stopped at true, anyone can do that action.
Source: Supabase: Storage access control
3. Four common storage mistakes
- Private files in a public bucket. The builder made the bucket public so images would load, then later used the same bucket for documents.
- Policies that use
true. A SELECT, INSERT, UPDATE or DELETE policy onstorage.objectswithtrueand nobucket_idcheck lets any visitor do that action in every bucket. - No owner check. A policy that only says
to authenticatedlets any signed-in user read or delete another user's files. Anyone can make an account, so this is close to public. - Using the service_role key to make uploads work. Service keys skip every storage policy. If one is in your frontend, anyone can read and delete every file. See Supabase anon vs service_role key.
4. The 2-minute logged-out test
- Look at each bucket. In the Supabase Dashboard, open Storage. Write down which buckets say Public and what kind of files each one holds.
- Open a file while signed out. Copy a link to an uploaded file from your app. Open it in a private browser window. If it opens and it is a private file, that bucket should not be public.
- Try to list files with only your public key. Your public (anon or
sb_publishable_) key is in your live site's JavaScript, so a stranger has it too. Run this, using your project URL, key and bucket name:
An empty listcurl -X POST "https://YOUR-PROJECT.supabase.co/storage/v1/object/list/BUCKET" \ -H "apikey: YOUR_PUBLIC_KEY" \ -H "Authorization: Bearer YOUR_PUBLIC_KEY" \ -H "Content-Type: application/json" \ -d '{"prefix":""}'[]means signed-out visitors can't list files there. A list of file names means they can. - Read your policies. In Storage → Policies, look for
true, missingbucket_idchecks and missing owner checks. Then open Advisors → Security Advisor and fix any storage warnings. - Try it as a second user. Make two test accounts. Upload a file as one, then try to open or delete it as the other. It should fail.
Your tables need the same test. See the Supabase RLS check.
Sources: Supabase: Storage access control · Supabase: createSignedUrl
5. Copy-paste fix prompts
Paste the matching prompt into Lovable, Bolt, v0, Replit or Cursor. Replace BUCKET_NAME with your bucket. Run the logged-out test again after you deploy.
List every Supabase Storage bucket in this project and tell me whether it is public or private and what kind of files it holds. Any bucket that holds user uploads that are not meant to be public (documents, ID photos, invoices, private images) must be private. Change those buckets to private. Where the app shows those files, replace getPublicUrl with createSignedUrl and a short expiry, and only create the signed URL after checking the signed-in user owns the file. Do not use the service_role or secret key in the browser.
Write a SQL migration with Row Level Security policies on storage.objects for the bucket named BUCKET_NAME. Signed-in users may upload only into a folder named after their own user id: (storage.foldername(name))[1] = (select auth.uid())::text. They may read, update and delete only their own files (same folder check). Signed-out users get no access. Remove any existing storage.objects policy that uses true or has no bucket_id check. Show me the SQL before you run it.
This project has a public Supabase Storage bucket for public images. Keep it public so image links work, but make sure no policy on storage.objects lets anyone list its files. Remove broad SELECT policies on storage.objects for this bucket (for example using (true)). Then run Supabase Security Advisor and tell me about any storage warnings that are left.
6. Check the rest of your app
VibeCheck does not test storage buckets yet, so use the steps above for those. For the rest, paste your link into VibeCheck. In about 10 seconds it checks the JavaScript your live site sends to visitors for leaked keys (including Supabase service_role and sb_secret_ keys, OpenAI and Stripe secret keys), checks whether your public Supabase key can read open tables, and checks security headers, SEO basics and broken links.
It is a public, read-only check of your live app. It never asks for your code or login, and it masks any secret key it finds.
Pricing: the problems list is free (just add your email). The $9 fix report gives you a copy-paste fix prompt for every problem found, or get the $29 10-pack. No subscription.
No tool can promise your app is 100% secure. VibeCheck catches common, costly mistakes before a stranger does.
7. FAQ
Are Supabase Storage buckets public by default?
No. Supabase says buckets are private by default. A bucket only becomes public if you (or your AI builder) turn on the Public setting when creating or editing it. AI builders sometimes do this to make images show up quickly, so it is worth checking each bucket.
What does a public Supabase bucket mean?
Supabase says a public bucket skips access control for reading and serving files. Anyone who has a file's URL can open it, without signing in. Uploading, deleting, moving and copying files are still controlled by your policies on the storage.objects table.
Is it OK to use a public bucket?
Yes, for files that are meant to be public, like profile pictures, product photos or blog images. It is not OK for private files like ID photos, invoices, contracts, medical documents or anything a user would not post online. Those belong in a private bucket.
How do I show a file from a private bucket?
Use a signed URL. In supabase-js, createSignedUrl makes a link that works for a limited time, for example 60 seconds or one hour. Your app should only create a signed URL after it checks that the signed-in user is allowed to see that file.
Can strangers list all the files in my bucket?
Only if a policy on storage.objects lets them. A SELECT policy that uses true, or that has no bucket or owner check, can let anyone with your public key list file names in a bucket. Supabase's Security Advisor can also warn you about public buckets that allow listing.
Does VibeCheck check my Supabase Storage buckets?
Not yet. VibeCheck checks your live app for leaked secret keys (including Supabase service_role and sb_secret_ keys), open database tables your public key can read, security headers, SEO basics and broken links. Use the test in this guide for your storage buckets.
More questions? See the VibeCheck FAQ. Related guides: Supabase RLS check · Supabase anon vs service_role key · Is my Lovable app safe? · Vibe coding security checklist.