Is my Supabase Storage bucket public? How do I fix it?
Short answer: decide whether public downloads are intended, then restrict the bucket or its object policies and verify both listing and retrieval. This guide explains what to verify and what the public scan cannot prove, without logging in, changing records, or treating an inconclusive response as a pass.
What the public Supabase Storage bucket check covers
A public bucket allows objects to be retrieved without a signed-in user. That may be appropriate for public images, but it is not appropriate for private uploads, documents, or user-specific exports.
The finding describes a public condition, not proof that someone has abused it. First preserve the relevant deployment details, then rotate exposed credentials or close the access path before investigating billing, logs, or affected records.
Bucket visibility and object policies are related but not identical. Review whether the bucket is public, whether listing is allowed, and what authenticated insert, update, or delete policies apply.
Understand the evidence before changing code
Identify the files and users the feature is meant to serve. If a bucket contains mixed public and private assets, separate them rather than relying on a frontend route to hide private object URLs.
Severity reflects potential impact and reach, not certainty of exploitation. A public key can be intentionally visible; the important distinction is what the provider allows that key to do and which server-side policy still applies.
Apply the narrow, safe change
Make the bucket private when public reads are not required, then add policies that tie each object path to the authenticated owner. Use signed URLs with a short lifetime for temporary access when appropriate.
create policy "owner reads own objects"
on storage.objects for select to authenticated
using (
bucket_id = 'private-files'
and (storage.foldername(name))[1] = (select auth.uid())::text
);Prefer the smallest repair that restores the intended boundary. Keep public client configuration public, move privileged operations behind an authenticated server route, and make data rules depend on the authenticated owner or an explicit role.
Verify the production result
Test direct object retrieval, listing, upload, and deletion as anonymous, owner, and unrelated user. Confirm cached public copies are addressed if a previously exposed object must no longer be available.
Use the snippet as a starting point, not a blind migration. Confirm the real table, environment, route, identity claim, and deployment platform first; a copied policy with the wrong owner field can block legitimate users or expose the wrong records.
Keep the issue from returning
Separate public assets from user uploads, name storage paths predictably, and test policies in migrations. Review new upload features because storage access can change independently of database RLS.
Verify the repair from the same public vantage point that exposed it. Check the deployed response, confirm the finding is gone, and test the intended signed-in user and an unrelated user through the normal application flow.
Limits and next steps
A scan cannot determine whether a public image was intentionally published or whether old copies remain elsewhere. Review the bucket contents and your product's privacy expectations.
Prevent recurrence with a reviewed migration, a secret scanner, and a small regression test that runs before deploy. Store only the minimum required credential, scope it to one project, and define who can rotate it.
A public scanner cannot establish whether private records were accessed or whether an account was compromised. If a real secret shipped, revoke it with the provider and review the provider's usage and audit history.
Key facts
- Public bucket visibility permits unauthenticated object retrieval.
- Object listing and object retrieval should be tested separately.
- Signed URLs provide time-limited access rather than changing the bucket to public.
Questions
Can a clean public Supabase Storage bucket check prove the app is secure?
What should I do first if the finding is real?
Does ProofForge change application data?
What should I do after the repair?
Official documentation referenced
Related
Last updated 2026-11-25 · Reviewed by ProofForge · Methodology · Markdown