medium · M9 · MASVS-STORAGE-1 · PTKD-BACKEND-SUPABASE-BUCKET-LISTING
Public Supabase bucket can be listed by anyone
A bucket is public and a SELECT policy on storage.objects lets anon or every user read its objects without tying them to the caller. Public buckets serve files by URL without any policy; the extra SELECT policy only adds the ability to list the bucket, which hands out the name (and so the URL) of every file in it.
How it is exploited
A 'receipts' bucket is public so the app can show images by URL, and an assistant also added `create policy "read receipts" on storage.objects for select using (bucket_id = 'receipts');`. Anyone calls `supabase.storage.from('receipts').list()` with the anon key and gets every user's receipt file name, then downloads each one.
Why it matters
Every file in the bucket becomes discoverable, including other users' uploads.
How to fix it
- Drop the SELECT policy: `drop policy "read receipts" on storage.objects;` (public URLs still work).
- Make buckets with user files private and serve them with signed URLs.
Does your app have this?
PTKD checks your build or your source project for PTKD-BACKEND-SUPABASE-BUCKET-LISTING and every other check in this knowledge base.
Scan your appReferences
Related checks (M9)
- Android file or preferences created world-readable or world-writable
- Public Supabase storage bucket (heuristic)
- Sensitive data written to external storage
- Sensitive data written to the log
- Secret written to device storage
- Tokens or passwords stored in plain app preferences
- Keychain item accessible while locked
- Tokens or passwords written to the device log