LatchDog

← Guides

Are my Supabase Storage files public? Buckets, RLS and signed URLs

Short answer: it depends on the bucket. A public Supabase Storage bucket serves every file to anyone who has its URL, with no policy check on the download. Private buckets keep downloads behind RLS on storage.objects (or a short-lived signed URL). Upload, delete, move and copy still need policies even on a public bucket. LatchDog's outside scan does not test Storage buckets or their policies, so the checks below are yours to run in the dashboard and SQL editor.

What "public" actually means

Supabase's bucket fundamentals page: "When a bucket is designated as 'Public,' it effectively bypasses access controls for both retrieving and serving files within the bucket. This means that anyone who possesses the asset URL can readily access the file." And: "Access control is still enforced for other types of operations including uploading, deleting, moving, and copying." Buckets are "private by default." Public buckets are "more performant than private buckets since they are cached differently." (Supabase: Storage Buckets / fundamentals, read Nov 13, 2026.)

Public URLs look like:

https://[project_id].supabase.co/storage/v1/object/public/[bucket]/[asset-name]

The SDK's getPublicUrl builds the same path (Supabase: Storage serving / downloads, read Nov 13, 2026). That is fine for avatars and blog images. It is a leak when receipts, contracts or other user uploads land in the same bucket, because the URL ends up in HTML, API responses, emails and browser history.

The other traps

Keep private files private (example)

These examples are for a private per-user documents bucket. Leave intentionally public assets (avatars, marketing images) in a separate public bucket.

  1. In the dashboard, confirm which buckets are public: or run select id, public from storage.buckets;
  2. Move user-specific files into a private bucket (for example documents). Switching an existing bucket from public to private breaks any stored public URLs, so plan the cutover.
  3. Upload under the owner's id, for example USER_ID/filename. Supabase's own example uses storage.foldername(name) for the first path segment.
  4. Write owner-scoped policies on storage.objects:
    create policy "upload own documents"
    on storage.objects
    for insert
    to authenticated
    with check (
      (select auth.uid()::text) = (storage.foldername(name))[1]
      and bucket_id = 'documents'
    );
    
    create policy "read own documents"
    on storage.objects
    for select
    to authenticated
    using (
      (select auth.uid()::text) = (storage.foldername(name))[1]
      and bucket_id = 'documents'
    );
    
    create policy "update own documents"
    on storage.objects
    for update
    to authenticated
    using (
      (select auth.uid()::text) = (storage.foldername(name))[1]
      and bucket_id = 'documents'
    )
    with check (
      (select auth.uid()::text) = (storage.foldername(name))[1]
      and bucket_id = 'documents'
    );
    
    create policy "delete own documents"
    on storage.objects
    for delete
    to authenticated
    using (
      (select auth.uid()::text) = (storage.foldername(name))[1]
      and bucket_id = 'documents'
    );

    Supabase's docs also show an owner_id form: owner_id = (select auth.uid()::text) for delete, and (select auth.jwt()->>'sub') = owner_id for select. Prefer one pattern and stick to it. The folder-per-user form above uses (select auth.uid()) cast to text so it matches the path segment; review the cast against your upload code.

  5. Serve private files with a short-lived signed URL from server code (createSignedUrl with an expiry in seconds), after you have checked that the requester is allowed to see the file. Private assets can also be fetched at /storage/v1/object/authenticated/... with the user's Authorization header.

How to test

  1. List buckets: select id, public from storage.buckets; — every public = true row should be intentional.
  2. List policies: select policyname, cmd, roles, qual, with_check from pg_policies where schemaname = 'storage' and tablename = 'objects'; Look for true conditions, anon on private data, and SELECT policies that do not check the owner or folder.
  3. Signed out, open a private-bucket file URL — it should fail. A public-bucket URL should load only if that file is meant to be public.
  4. Sign in as a second test user and try to list or download the first user's folder — both should fail.
  5. Run Security Advisor and fix public bucket allows listing and related findings before you ship.

Related: Supabase RLS for vibe-coded apps, rls_disabled_in_public and other Advisor errors, is the Supabase anon key safe to expose?, and how to monitor your Supabase app for leaked keys and open RLS.

Paste-in fix prompt

Review my Supabase Storage setup before I publish. Please:
1. List every bucket and whether it is public. For each public bucket, say whether every file in it is meant to be public. Move user-specific files into a private bucket.
2. Show every policy on storage.objects. Replace any with check (true) or using (true) on private data with owner-only policies, one per operation, written "to authenticated", scoped to the bucket, and matching the first path folder to (select auth.uid()::text) via storage.foldername(name) — or to owner_id, if that is how we store ownership. Upsert needs SELECT and UPDATE as well as INSERT.
3. Make sure private downloads use createSignedUrl (short expiry) or the authenticated object URL, never a /object/public/ URL.
4. Search the code for sb_secret_ and service_role; those must not be in the browser.
5. Do not make a private bucket public to "fix" a download, do not disable RLS, and do not change unrelated code.
Show me the SQL and the list of buckets first, then explain who can read and write what afterwards.

Check yours

Run select id, public from storage.buckets; and Security Advisor now. Then run the free LatchDog check on your live URL: it will not find a public Storage bucket, but it will look for a leaked secret key that would bypass Storage RLS entirely.

What LatchDog does here (and doesn't)

LatchDog does not test Supabase Storage. Its Supabase check only sends read requests to the Data API (/rest/v1/…): after you verify your domain, one SELECT ... LIMIT 1 to each of up to 15 tables or views your site's code names with .from("..."), recording only whether a row came back. It never calls /storage/v1/, never lists buckets, never downloads objects, and cannot see storage.objects policies. A public bucket, a listing policy, or a missing owner check will not show up in a LatchDog report. Use the SQL above and Security Advisor for Storage; use LatchDog for leaked keys in your live JavaScript, exposed .env/.git, headers/HTTPS, and (deep scan) whether named tables or views return rows to the publishable key.

LatchDog keeps watching your live app after launch. Starter ($19/month, up to 3 apps) and Pro ($39/month, up to 10 apps) re-scan it automatically every day and after every deploy (triggered by a deploy hook from your host or CI), and email you only when something changes. Nothing to install: you verify your domain once.

Keep watching your app, not just checking it once

LatchDog keeps watching your live app after launch. Starter ($19/month, up to 3 apps) and Pro ($39/month, up to 10 apps) re-scan it automatically every day and after every deploy (triggered by a deploy hook from your host or CI), and email you only when something changes. Nothing to install: you verify your domain once.

Start with the free check (headers, HTTPS, leaked keys in your JavaScript, source maps, .env/.git). Open-table checks run after you verify your domain. See plans

Free, read-only public check: no sign-up, no card. Headers, HTTPS, leaked keys in your JavaScript (always masked), public source maps and exposed .env/.git files. Supabase table checks run after you verify you own the domain.

Want the open-table check too? Get my free deep scan: sign in with your email (no password) and verify you own the domain. Your first deep scan is free and adds CORS, more of your JavaScript and, if your app uses Supabase, whether anyone can read its tables and views with your public key.