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

    1. Set the bucket to private: `update storage.buckets set public = false where id = 'documents';`.
    2. Add storage policies that check `auth.uid()` against the folder or owner column.
    3. 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 app

    References

    Related checks (M9)