LeakLatch

For Supabase Storage

Is my Supabase Storage bucket public?

Direct answer

If a Supabase Storage bucket is public, anyone who has a file’s URL can download it. Uploads and deletes can still be protected, which is why the switch is often flipped to make a preview load. That is fine for avatars and marketing images. It is not fine for user documents. Check the setting in the dashboard, and serve sensitive files from a private bucket with signed URLs.

LeakLatch does not inspect Storage bucket policies. What it will do, on a live URL you own, is a read-only search of the page and its JavaScript for leaked secrets, a read-only table list when a public Supabase URL and anon key are already on the page, and a basic security-header check. You get a risk score, redacted findings, and a fix prompt. Use this guide for buckets; use the scan for keys and open tables.

Owner checks

How to check buckets on a project you own

Use these on a Supabase project you own or have permission to administer. They are configuration checks, not a penetration test, and they do not require writing new objects into the bucket.

  1. Step 1

    Open the bucket in the Supabase dashboard

    In the project that serves your live app, go to Storage and open each bucket. The dashboard shows whether the bucket is public. A public bucket is a setting on the bucket itself, not something you can reliably infer by searching your frontend JavaScript. Check every bucket, including ones you created to “just make the upload work.”

  2. Step 2

    Understand what “public” does and does not bypass

    Supabase documents this clearly: a public bucket bypasses access controls for retrieving and serving files, so anyone who has a file’s URL can download it. Uploads, deletes, moves, and copies are still checked against your policies, which is why the setting can look safe. Public is the right choice for avatars, marketing images, and other files you would be comfortable posting on a website. It is the wrong choice for ID scans, invoices, medical files, or user documents.

  3. Step 3

    Look at how file URLs escape the app

    A public object URL is enough. Those URLs show up in server logs, analytics, referrer headers, emails, chat messages, and screenshots. If a bucket is public, you should assume that anyone who ever saw a link — or who can guess or enumerate a path — can fetch the file. If your app puts user-specific documents under predictable names (user id, email, invoice number), treat that as a higher risk.

  4. Step 4

    For private buckets, confirm policies on storage.objects

    Switching a bucket to private is not complete until the right Row Level Security policies exist on storage.objects, and the app serves files with short-lived signed URLs (createSignedUrl or a signed upload). A private bucket with no policy will block legitimate users; a private bucket with a policy that allows the anon role to select every object is still too open. Review the policies the same way you would review table RLS.

  5. Step 5

    Fix the data that already leaked, then re-check the live app

    Files that were public should be treated as copied. Remove or replace anything sensitive, move the bucket to private, update the app to use signed URLs, and confirm the old public URL no longer serves the file — or that the file is gone. Separately, check whether the live frontend is leaking secrets or leaving tables readable without RLS.

Why this comes up

Public is a retrieval setting, not a bug

Supabase’s own documentation on bucket fundamentals is the source of truth: a public bucket skips access control for downloads. The feature exists because many apps need a simple public URL for images. Problems start when an upload fails in the preview, a prompt suggests “make the bucket public,” and the same bucket later holds files you would not post on the internet.

See Supabase Storage bucket fundamentals. A shorter version of this point is also on the LeakLatch blog. For tables rather than files, use how to check RLS on every table.

Because bucket visibility lives in the project config, a JavaScript scanner will not reliably detect it. Do not wait for a leaked-key report to tell you a document bucket is public — open Storage and look. After you lock the buckets down, a LeakLatch scan is still worth running so you know whether the live frontend is also shipping a service_role key or leaving a table readable.

Copy-paste fix

Prompt you can paste into Cursor or Claude

After you decide which buckets must be private, paste this into Cursor, Claude, or Lovable and point it at your own project.

You are helping me fix Supabase Storage on a project I own. Do not make sensitive buckets public. Keep existing product behavior working for legitimate users.

1. List every Storage bucket. For any bucket that holds user documents, invoices, IDs, or other sensitive files, set the bucket to private. Leave a bucket public only if every object in it would be acceptable on a public website (for example avatars or marketing images).
2. Add Row Level Security policies on storage.objects so that only the intended users can upload, update, delete, or (for private buckets) download their objects. Do not add a policy that lets the anon role select every object.
3. Update the app to serve private files with createSignedUrl links that expire, and use signed uploads where needed. Remove any use of a permanent public object URL for sensitive files.
4. Treat files that were public as potentially copied. Remove or replace sensitive objects that were reachable under a public URL.
5. Do not log or print full secret keys. Do not put a Supabase service_role or sb_secret_ key in client code.

FAQ

Straight answers about public buckets

Does LeakLatch tell me if a Storage bucket is public?

No. LeakLatch does not read your Storage bucket settings or storage.objects policies. It is a read-only scan of a live URL you own: it searches the page and its public JavaScript for leaked secrets, and when a public Supabase URL and anon key are already on the page it may list table names and row counts for tables readable without RLS. It also checks basic security headers. Use the Supabase dashboard for bucket visibility.

The file URL looks random. Is a public bucket still a problem?

Unpredictable names help a little, but they are not access control. Links leak through logs, referrers, and forwards. If the file should not be downloadable by a stranger who has the URL, the bucket should be private and the app should use a signed URL that expires.

I only made it public because the upload preview was broken. Now what?

That is a common reason this happens, including in apps written with AI tools. Move the bucket back to private, add a policy so the signed-in user can upload and read their own objects, and switch the app to createSignedUrl (and signed uploads if you need them). Then rotate or replace any document that was reachable while the bucket was public.

Is this a substitute for checking table RLS?

No. Public tables and public buckets are separate issues. A site can have perfect Storage settings and still leave a table readable with the anon key, or the other way around. See how to check RLS on every table, and run a read-only scan for leaked keys and open tables if you own the URL.

After the buckets, check the live frontend

Paste a URL you own. LeakLatch looks for leaked keys and open Supabase tables, read-only, and returns a fix prompt.

Scan my site free