CCyberwiki

Public cloud storage bucket

Public cloud storage bucket
ClassSecurity misconfiguration; Data exposure
Also known asPublicly accessible bucket; listable bucket
CWECWE-732: Incorrect Permission Assignment for Critical Resource; CWE-548: Exposure of Information Through Directory Listing
OWASP Top 10A02:2025 Security Misconfiguration; CWE-732 and CWE-548 are listed under A01:2025 Broken Access Control
MITRE ATT&CKT1530 Data from Cloud Storage
AffectsBuckets 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

Table 1. Who can read a Supabase bucket, by setting.
Bucket settingDownload by known pathList the files
Private, policy limited to the ownerThe owner, or a holder of a signed URLAs the policies allow
Public, no SELECT policyAnyone with the URLNo
Public, SELECT policy on bucket_id aloneAnyone with the URLAnyone 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-prevention

Prompt 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

References

  1. a b MITRE. "CWE-732: Incorrect Permission Assignment for Critical Resource". Common Weakness Enumeration.
  2. back MITRE. "CWE-548: Exposure of Information Through Directory Listing". Common Weakness Enumeration.
  3. back "A02:2025 Security Misconfiguration". OWASP Top 10:2025. OWASP Foundation.
  4. back "A01:2025 Broken Access Control". OWASP Top 10:2025. OWASP Foundation.
  5. back "Learn the core syntax of the Firebase Security Rules for Cloud Storage language". Firebase documentation. Google.
  6. a b c d "0025 public bucket allows listing". Supabase Docs, database advisors. Supabase.
  7. 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.
  8. a b c "Storage Buckets". Supabase Docs. Supabase.
  9. a b c d "Avoid insecure rules". Firebase Security Rules documentation. Google.
  10. a b "Serving assets from Storage". Supabase Docs. Supabase.
  11. back "Storage Quickstart". Supabase Docs. Supabase.
  12. a b "Storage Access Control". Supabase Docs. Supabase.
  13. a b "Blocking public access to your Amazon S3 storage". Amazon S3 User Guide. AWS.
  14. back MITRE. "Data from Cloud Storage, T1530". MITRE ATT&CK.
  15. back Tea Dating Advice (July 2025). "Official statement" (archived 28 July 2025). teaforwomen.com.
  16. back Maiberg, Emanuel; Cox, Joseph (25 July 2025). "Women Dating Safety App 'Tea' Breached, Users' IDs Posted to 4chan". 404 Media.
  17. back Jordan, Dearbail (26 July 2025). "Hackers steal images from women's dating safety app that vets men". BBC News.
  18. back "Advisors". Supabase Docs. Supabase.
  19. a b "Configuring block public access settings for your S3 buckets". Amazon S3 User Guide. AWS.
  20. back "Get started with Firebase Security Rules". Firebase documentation. Google.
  21. back "put-public-access-block". AWS CLI Command Reference. AWS.
  22. back "Public access prevention". Cloud Storage documentation. Google Cloud.
  23. back "Use public access prevention". Cloud Storage documentation. Google Cloud.