Skip to main content

Are your users' uploads public? Supabase Storage buckets, signed URLs and the policies that matter

Public bucket means anyone with the URL. How to tell which buckets are public, what listing adds, how signed URLs work, and a policy set for private files.

Updated 6 min readMarkdown

If your app lets people upload files, Supabase Storage is probably holding them: profile photos, receipts, ID scans, resumes, exported reports. The question is whether a stranger can open those files, and the answer depends on three separate settings that AI builders often mix up: whether the bucket is public, whether file listing is allowed, and which policies exist on storage.objects.

Here's how Supabase's docs define each, a five-minute check you can run on your own project, and the fix for private files.

Public vs private, in Supabase's words

Supabase Storage has two access models:

  • Private bucket: every operation, including downloads, goes through RLS policies. Files can be fetched with a signed-in user's JWT, or through a signed URL that expires. Supabase says buckets are private by default.
  • Public bucket: "Anyone with the asset URL can access the file." Downloads skip access control. Uploading, deleting, moving and copying are still checked.

Public buckets follow a predictable URL shape: https://[project_id].supabase.co/storage/v1/object/public/[bucket]/[asset-name]. Supabase lists profile pictures, public media and blog images as good uses for public buckets, and "users' sensitive documents" as the use for private ones.

If your tool created a bucket named uploads or documents and set it to public to make images show up on the page, every file in it is open to whoever has or guesses the URL.

The three-part check

Run these on your own project.

1. Which buckets are public? In the SQL editor:

select id, name, public from storage.buckets order by public desc;

Any bucket with public = true that holds anything private is the finding.

2. Can a stranger open a file? Copy one file's public URL from your app, paste it into a private window where you're signed out. If it opens, it's public. Do this for a file that belongs to a user, not just the logo.

3. What do the Storage policies allow? Supabase says policies on storage.objects "control every file operation," including list, upload, download and delete, in both public and private buckets. Look at them:

select policyname, cmd, roles, qual, with_check
from pg_policies
where schemaname = 'storage' and tablename = 'objects';

Red flags:

  • A select policy with qual of true for a bucket with private files. That allows anyone to list or read it. Supabase's own avatar example adds storage.allow_any_operation(...) to a policy specifically because "without it users would be able to list the bucket contents."
  • An insert, update or delete policy with true and no restriction to a bucket or a user. Supabase's docs show with check (true) as the starting point of an example, to be narrowed. Narrowing is the part that gets skipped.
  • Policies with no to authenticated role limit where you expected one.

Also think about guessability. A public bucket whose files are named invoice-1.pdf, invoice-2.pdf is open to enumeration even with listing blocked. Random names reduce that risk but don't turn a public bucket into a private one.

The fix for private files

  1. Make a private bucket for anything sensitive and keep the public one for assets that are meant to be public. If you flip an existing bucket to private, any saved public URLs stop working, so update the app first.
  2. Serve with signed URLs. Create them on the server with createSignedUrl, using a short expiry:
const { data, error } = await supabase.storage
  .from("documents")
  .createSignedUrl("user-123/passport.pdf", 3600); // seconds

Supabase notes you can't revoke an individual signed URL. To kill one, delete, move or rename the underlying object. To kill all of them, rotate the project's URL signing key and revoke the old one.

  1. Scope policies to the user. Supabase's folder example lets authenticated users upload only into a folder named for their own user id:
create policy "Users upload into their own folder"
on storage.objects for insert to authenticated
with check (
  bucket_id = 'documents' and
  (storage.foldername(name))[1] = (select auth.jwt()->>'sub')
);

Add matching select, update and delete policies on the same folder condition.

  1. Know how ownership works. Storage records an owner_id for files created through the API with a user's JWT. Supabase's docs say files created with the service key or in the Dashboard have no owner set, so a policy that checks owner_id won't match them. Folder-based policies are the safer pattern if you upload some files by hand.

  2. Keep the service key out of the browser. Supabase says service keys entirely bypass Storage RLS policies. If one is in your frontend, nothing above matters: https://proofforge.live/fix/service-role-key-exposed

When the upload fails with an RLS error

"New row violates row-level security policy" on an upload usually means there is no insert policy on storage.objects for that user and bucket. Supabase says no uploads are allowed without a policy, and the only policy needed for a plain upload is insert. Using upsert to overwrite also needs select and update. The wrong fix is to make the bucket public or add a policy of true. The right one is a narrow insert policy. More here: https://proofforge.live/errors/supabase-storage-new-row-rls

Test it as two real users

Policies are easy to get right for one account and wrong for the second. Sign in as user A, upload a file, then try to read, replace and delete it as user B. This builds a script you can run yourself: https://proofforge.live/two-account-test. For tables rather than files, the free browser tool at https://proofforge.live/tools/supabase-rls-checker does the same kind of check, and https://proofforge.live/guides/how-to-test-if-your-supabase-data-is-public covers the rest of your data.

What a scan can and can't tell you here

ProofForge's scan is outside-in and read-only, with no login. It has a check for public Supabase Storage exposure, and it reports what an anonymous visitor can reach: https://proofforge.live/fix/supabase-storage-public. It can't see your bucket settings or policies, can't sign in as a user, and never uploads or deletes, so it can't tell you whether your upload and delete policies are tight. The queries above cover that.

Why the $9 helps

Storage fixes tend to go round and round with an AI builder: the upload breaks, the tool loosens a policy, the files open up again. Run the free scan first: you get your grade, each finding's severity and impact, and the top fix in full. $9 once unlocks every finding with exact code fixes and prompts for your builder. There's a 14-day refund and no subscription: https://proofforge.live/pricing

Start with the free scan on your live URL: https://proofforge.live

Sources, checked December 1, 2026:

  • Supabase docs, "Storage buckets," supabase.com/docs/guides/storage/buckets/fundamentals
  • Supabase docs, "Storage Access Control," supabase.com/docs/guides/storage/security/access-control
  • Supabase docs, "Serving assets from Storage," supabase.com/docs/guides/storage/serving/downloads
  • Supabase docs, "Storage ownership," supabase.com/docs/guides/storage/security/ownership
  • ProofForge tiers, proofforge.live/pricing.json

No comments yet. Be the first to comment.