Public cloud storage bucket
| Class | Security misconfiguration; Data exposure |
|---|---|
| Also known as | Publicly accessible bucket; listable bucket |
| CWE | CWE-732: Incorrect Permission Assignment for Critical Resource; CWE-548: Exposure of Information Through Directory Listing |
| OWASP Top 10 | A02:2025 Security Misconfiguration; CWE-732 and CWE-548 are listed under A01:2025 Broken Access Control |
| MITRE ATT&CK | T1530 Data from Cloud Storage |
| Affects | Buckets in Supabase Storage, Firebase Storage, Amazon S3 and Google Cloud Storage that allow anonymous reads or listing |
Anyone who has the address of a file in a public cloud storage bucket can download it without signing in. In the more serious form the bucket also hands out a list of every file it holds. The fault is a permission that lets unintended actors read or change a resource that matters, and a storage account open to anonymous users is the textbook case.1 The listing adds a second one: information exposed through a directory listing.2 Cloud permissions left this wide count as a misconfiguration,3 although both faults are filed under broken access control.4
Description
Storage services can grant two kinds of read separately: fetching a file whose path the client knows, and listing the files in the bucket. Firebase's rules language splits a read into get and list.5 Supabase serves the files of a public bucket by URL, while listing depends on a separate policy.6 When a bucket only serves files, an attacker has to know or guess each name; a listing supplies them.
The defaults are private. S3 buckets and objects have always been private by default, and since April 2023 S3 turns on Block Public Access and disables access control lists (ACLs) for new buckets.7 Supabase buckets are private by default.8 Firebase asks, when a bucket is created in its console, whether to start in Locked mode, which denies access to all users, or Test mode, which grants access to all users.9
Mechanism
Supabase Storage
In a private Supabase bucket, all operations, downloads included, pass through row level security policies on the storage.objects table. Marking a bucket public bypasses access control for retrieving and serving its files, so anyone with a file's URL can download it; uploads, deletes, moves and copies are still checked.8 The files of a public bucket have addresses of this form:10
https://[project_id].supabase.co/storage/v1/object/public/[bucket]/[asset-name]Listing is granted by a SELECT policy on storage.objects. A public bucket does not need one for clients to fetch known paths, yet the Storage quickstart's own example creates a policy that covers the whole bucket:11
create policy "Public Access" on storage.objects for select using ( bucket_id = 'public' );Supabase's database advisor flags this combination as lint 0025, level WARN. It reports a public bucket that has a broad SELECT or ALL policy for the public, anon or authenticated roles, such as bucket_id = 'avatars' or true, because clients can then enumerate its files. A policy that adds an owner or path condition is not flagged.6 The publishable key that the frontend sends is enough to list.12
| Bucket setting | Download by known path | List the files |
|---|---|---|
| Private, policy limited to the owner | The owner, or a holder of a signed URL | As the policies allow |
Public, no SELECT policy | Anyone with the URL | No |
Public, SELECT policy on bucket_id alone | Anyone with the URL | Anyone with the publishable key |
Firebase Storage
The rule below opens every file in the bucket to any user. Without authentication and rules, anyone who guesses the project ID can steal, modify or delete the data, and a rule that checks only auth != null admits any signed-in user.9
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}Amazon S3 and Google Cloud Storage
S3 counts a bucket or object ACL as public when it grants any permission to the predefined AllUsers or AuthenticatedUsers groups, and AWS gives a policy that allows "Principal": "*" as an example of a public policy.13 In Google Cloud Storage, a bucket IAM policy that grants a role to allUsers or allAuthenticatedUsers opens the bucket in the same way.1
Impact
Credit card data, personally identifiable information and medical records have all leaked from open buckets, and the ShinyHunters group has collected data from insecure ones.14 A listing often reveals more than the owner meant to share.6 Where writes are open as well, an attacker can modify or delete the files.9
Notable incidents
Tea (2025)
At 6:44 AM PST on 25 July 2025, the dating safety app Tea identified unauthorized access to a legacy data storage system holding data from before February 2024. The dataset held about 72,000 images: about 13,000 selfies and photo IDs submitted during account verification, and about 59,000 images from posts, comments and direct messages. It said no email addresses or phone numbers were accessed.15
Tea's statement does not name the storage service. 404 Media reported on 25 July that 4chan users claimed to have found an exposed database on Firebase belonging to Tea, and quoted a post: "No authentication, no nothing. It's a public bucket".16 The BBC noted that Tea's privacy policy promised photo IDs were "deleted immediately" after authentication.17
Detection
In Supabase, the Security Advisor in Studio runs lint 0025. The same checks run from the command line with supabase db advisors, and over MCP with get_advisors and type set to security.18 In the S3 console, the IAM Access Analyzer column of the Buckets list shows whether a bucket is publicly accessible.19 Firebase Storage rules are in the Firebase console under Storage, then Security Rules.20
Prevention
Supabase
Profile pictures and blog post content suit a public bucket; users' sensitive documents belong in a private one.8 To stop a public bucket from listing, drop the broad policy; object URLs keep working. To make the bucket private instead, change its public flag:6
drop policy if exists "Public bucket listing" on storage.objects;
update storage.buckets
set public = false
where id = 'avatars';In a private bucket, this policy lets each signed-in user read only the files they own:12
create policy "Individual user Access"
on storage.objects for select
to authenticated
using ( (select auth.jwt()->>'sub') = owner_id );A Signed URL gives time-limited access to one private file. A single signed URL cannot be revoked: the file has to be deleted, moved or renamed, or the project's URL signing key rotated, which invalidates all of them.10
const { data, error } = await supabase.storage
.from('bucket')
.createSignedUrl('private-document.pdf', 3600)Firebase
Store each user's files under their own ID and allow access only to that user:9
service firebase.storage {
match /b/{bucket}/o {
// Files look like: "user/<UID>/file.txt"
match /user/{userId}/{fileName} {
allow read, write: if request.auth.uid == userId;
}
}
}Amazon S3
Block Public Access has four settings, and the recommended setup turns on all four for the whole account. Set at that level, BlockPublicPolicy keeps blocking public policies even when a user who may change a bucket policy alters it.13 For one bucket, from the command line:21
aws s3api put-public-access-block \
--bucket amzn-s3-demo-bucket \
--public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"In the console, open the bucket, choose Permissions, then Edit next to Block public access (bucket settings).19
Google Cloud Storage
With public access prevention enforced, requests authorized through allUsers or allAuthenticatedUsers fail with 401 or 403, while signed URLs still work.22 To enforce it:23
gcloud storage buckets update gs://BUCKET_NAME --public-access-preventionPrompt for a coding agent
List every storage bucket this project creates or uses (Supabase Storage, Firebase Storage, Amazon S3, Google Cloud Storage), from code, migrations, rules files and config. For each one, say whether it is public, and whether a policy or rule lets anyone list its files. In Supabase, find SELECT or ALL policies on storage.objects that check only bucket_id or are always true, and propose dropping them or adding an owner condition. Any bucket that holds user uploads, documents, ID photos, invoices or exports should be private, with files served through signed URLs or owner-only policies. For Firebase, replace allow read, write rules that have no condition with rules tied to request.auth.uid. For S3, add the four Block Public Access settings. Show me each change before you make it.
In SecFlash
SecFlash reports SF-EXP-214 on the Exposure page for a storage bucket that serves its files, or lists them, without a sign-in. On the Cloud page it reports SF-CLD-526 for a public Supabase bucket, SF-CLD-515 when a public bucket lets anyone list its files, SF-CLD-312 for a public Cloudflare R2 bucket and SF-CLD-211 for a DigitalOcean Space that lists its files to anyone.
See also
- Row level security
- Exposed backups
- Exposed sensitive files
- Privileged key in client-side code
- Securing a Firebase application
- Principle of least privilege
- Category: Security misconfiguration
- Category: Data exposure
References
- a b MITRE. "CWE-732: Incorrect Permission Assignment for Critical Resource". Common Weakness Enumeration.
- back MITRE. "CWE-548: Exposure of Information Through Directory Listing". Common Weakness Enumeration.
- back "A02:2025 Security Misconfiguration". OWASP Top 10:2025. OWASP Foundation.
- back "A01:2025 Broken Access Control". OWASP Top 10:2025. OWASP Foundation.
- back "Learn the core syntax of the Firebase Security Rules for Cloud Storage language". Firebase documentation. Google.
- a b c d "0025 public bucket allows listing". Supabase Docs, database advisors. Supabase.
- back Barr, Jeff (13 December 2022, updated 27 April 2023). "Heads-Up: Amazon S3 Security Changes Are Coming in April of 2023". AWS News Blog.
- a b c "Storage Buckets". Supabase Docs. Supabase.
- a b c d "Avoid insecure rules". Firebase Security Rules documentation. Google.
- a b "Serving assets from Storage". Supabase Docs. Supabase.
- back "Storage Quickstart". Supabase Docs. Supabase.
- a b "Storage Access Control". Supabase Docs. Supabase.
- a b "Blocking public access to your Amazon S3 storage". Amazon S3 User Guide. AWS.
- back MITRE. "Data from Cloud Storage, T1530". MITRE ATT&CK.
- back Tea Dating Advice (July 2025). "Official statement" (archived 28 July 2025). teaforwomen.com.
- back Maiberg, Emanuel; Cox, Joseph (25 July 2025). "Women Dating Safety App 'Tea' Breached, Users' IDs Posted to 4chan". 404 Media.
- back Jordan, Dearbail (26 July 2025). "Hackers steal images from women's dating safety app that vets men". BBC News.
- back "Advisors". Supabase Docs. Supabase.
- a b "Configuring block public access settings for your S3 buckets". Amazon S3 User Guide. AWS.
- back "Get started with Firebase Security Rules". Firebase documentation. Google.
- back "put-public-access-block". AWS CLI Command Reference. AWS.
- back "Public access prevention". Cloud Storage documentation. Google Cloud.
- back "Use public access prevention". Cloud Storage documentation. Google Cloud.
External links
- Storage Access Control, Supabase Docs
- Blocking public access to your Amazon S3 storage, Amazon S3 User Guide