medium · M9 · MASVS-STORAGE-1 · PTKD-BACKEND-SUPABASE-PUBLIC-BUCKET
Public Supabase storage bucket (heuristic)
A storage bucket is created as public: every file in it can be downloaded by anyone with its URL, with no login and no policy check. Fine for logos, wrong for user uploads such as ID photos, invoices or private media.
How it is exploited
User passport scans go to a public 'documents' bucket. File names follow user ids, so anyone who learns one URL can guess the rest and download every document.
Why it matters
Exposure of private files; public URLs also end up in logs, analytics and search engines.
How to fix it
- Set the bucket to private: `update storage.buckets set public = false where id = 'documents';`.
- Add storage policies that check `auth.uid()` against the folder or owner column.
- Serve files with short-lived signed URLs.
Does your app have this?
PTKD checks your build or your source project for PTKD-BACKEND-SUPABASE-PUBLIC-BUCKET 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 bucket can be listed by anyone
- 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