Who can read your Supabase Storage files?
A public Supabase bucket lets anyone with the file URL read it. Learn how policies, private buckets and signed URLs decide who can read and upload.
In Supabase Storage, anyone who has the URL of a file in a public bucket can read it, with no sign-in. Private buckets check policies on storage.objects for every read. Uploads, deletes and moves need a policy in both kinds of bucket. Signed URLs give temporary read access to a private file.
What does "public bucket" mean in Supabase Storage?
A bucket is either public or private. Private is the default.
In a public bucket, downloads skip access control. Anyone with the file URL can read the file. Uploading, deleting, moving and copying still need policies.
In a private bucket, every operation goes through Row Level Security. A download works in one of two ways: the request carries the user's JWT and a policy allows it, or it uses a signed URL that works for a limited time.
"Public" does not mean "listed". It means that if someone has or guesses the path, the file opens. Paths often contain user IDs, order numbers or file names, and those leak through page source, emails and screenshots.
Why does this matter for AI-built apps?
AI tools tend to pick whatever makes the upload demo work. A public bucket works on the first try, with no policy to write. Then the app grows. The same bucket now holds ID scans, invoices, signed contracts, or avatars that sit next to a full name and an address.
Each of those files can be opened by anyone who has the link. The link may be in an API response, in a shared page, or in a chat export. Nothing in the app fails, so nobody notices.
Policies on storage.objects are the other half. Supabase says that policies apply to upload, download, list, move, copy, update, delete and signed URL creation. A policy written as "any signed-in user can read everything in this bucket" is a quieter version of the same problem. Any account holder can read every other user's files.
How do you check without code?
You can do this in about ten minutes. You do not need to read any code, and you do not need a second account.
- Open your Supabase dashboard and go to Storage. Look at each bucket and write down whether it is public or private.
- For every public bucket, ask one question: would I be fine if a stranger read every file in here? Avatars and blog images, maybe. Invoices and IDs, no.
- Open one file from a public bucket. Copy its URL. Paste it into a private browser window where you are signed out. If the file opens, anyone with the link can read it.
- In the dashboard, open the Storage policies for private buckets. Read each one in plain words. "Anyone logged in can read all files" and "only the person who uploaded the file can read it" are very different rules.
- Ask where your app shows file links. If a link ends up in an API response, a public page or an email, treat it as shared.
If a bucket mixes both kinds of files, split it. Moving files later is harder than choosing the right bucket on day one, and old links keep working until you change the bucket. Keep public things (logos, blog images) in a public bucket and personal files in a private one.
For developers: how do you fix it?
Make the bucket private, then add policies that tie each file to its owner. A simple pattern is one folder per user, named with the user's ID.
Switch the bucket to private:
update storage.buckets
set public = false
where id = 'documents';Or from an admin script (this needs the service key, so it never belongs in browser code):
const { error } = await supabaseAdmin.storage.updateBucket('documents', {
public: false,
})Add policies on storage.objects. The first lets a signed-in user upload only into their own folder. The second lets them read only from it. The form below follows the Supabase access control examples.
create policy "Users upload to their own folder"
on storage.objects for insert to authenticated
with check (
bucket_id = 'documents'
and (storage.foldername(name))[1] = (select auth.jwt()->>'sub')
);
create policy "Users read their own folder"
on storage.objects for select to authenticated
using (
bucket_id = 'documents'
and (storage.foldername(name))[1] = (select auth.jwt()->>'sub')
);Overwriting a file with upsert also needs select and update policies, as the access control page notes. Add them only if you need that.
Upload from the client, with the user's ID as the first folder:
const { data: { user } } = await supabase.auth.getUser()
const { error } = await supabase.storage
.from('documents')
.upload(`${user.id}/invoice-2026-11.pdf`, file)To show a private file, create a signed URL. The createSignedUrl reference takes the path and expiresIn, which is a number of seconds.
const { data, error } = await supabase.storage
.from('documents')
.createSignedUrl(`${user.id}/invoice-2026-11.pdf`, 300)
if (data) window.open(data.signedUrl)Two things to know about signed URLs. Anyone who holds the URL can use it until it expires, and the access control page says Storage skips the policy check for downloads made through a signed URL. So keep the expiry short, create the URL on demand, and never store it in your database. Store the file path instead.
Last, the service key skips Row Level Security entirely. Keep it on the server.
Sources
- Supabase Docs, "Storage Buckets" (fundamentals): https://supabase.com/docs/guides/storage/buckets/fundamentals, read 2026-11-28
- Supabase Docs, "Storage Access Control": https://supabase.com/docs/guides/storage/security/access-control, read 2026-11-28
- Supabase Docs, "JavaScript reference: createSignedUrl": https://supabase.com/docs/reference/javascript/storage-from-createsignedurl, read 2026-11-28
If you want a second look at your project, ShipSafe can scan it: ship-safe.co/scan.
Questions and answers
- Is a Supabase public bucket listed for everyone?
- The docs describe public buckets as open for reads, so do not rely on obscurity. Anyone with the exact file URL can read a file in a public bucket, and Supabase does not ask for authorization on those reads. Paths that contain user IDs or predictable names are easy to share by accident. If a file is personal, keep it in a private bucket.
- Do I need a policy for a public bucket?
- For reading through the public URL, no. Supabase skips access control for that. For uploading, deleting, moving and copying, yes. Without an insert policy on `storage.objects`, uploads to the bucket are not allowed by default. Write policies that name the bucket and tie each file to its owner.
- How long does a Supabase signed URL last?
- You choose. The `expiresIn` argument of `createSignedUrl` is a number of seconds, so 60 is one minute. The docs do not set a default in the reference page I read. Pick the shortest time that fits the use, such as the time to open an invoice, and create a fresh URL each time.
- Can a signed URL be shared?
- Yes. Anyone who has the URL can open the file until it expires. The policy check is skipped for downloads through a signed URL. This is why short expiry matters, and why you should create the URL for a user only after you have checked that the user may see the file.
- Can I move files from a public to a private bucket?
- Switching a bucket from public to private changes how reads work, but your app must also change. Any saved public URLs stop working, so update code to store paths and create signed URLs when needed. Test with a signed-out browser window, and with two different user accounts.
You just read what AI builders ship. Now check yours.
Paste your GitHub URL. 2 minutes. You get the findings in plain English, and the report says what it could not check. Free, no card.
Scan My App Free