Review request

Wedding photography booking page from v0, are my client galleries public?

Open · 87 viewsasked by yuki_builds

Repo or live app

studio-sato.example.com ↗

Unsure about: Security

Couples book a shoot and later get a private gallery link. v0 generated the upload flow and put everything in a Supabase Storage bucket called galleries, one folder per booking. The links are long random strings, which felt safe enough at the time. I would like someone to tell me whether that is actually private or just hard to guess.

Comment
Is the bucket marked public? If so, the long string is the only protection, and links get forwarded. Private bucket plus signed URLs is the usual answer. lena_ops

1 answer

mo_saleh

Lena's guess is right. I made a test booking and looked at the image URLs: they contain /storage/v1/object/public/galleries/, so the bucket is public. That means two things.

The random folder name is the only protection, and it never expires. Couples forward the link, it lands in a family group chat, and you can't take it back short of renaming the folder.

Also check whether the bucket can be listed. If there's a select policy on storage.objects for galleries that allows anon, anyone can list every folder, and the long strings stop being secret at all.

What I'd do: make the bucket private, and have the gallery page look up the booking and create signed URLs server-side:

const { data } = await supabase.storage.from('galleries')
  .createSignedUrls(paths, 60 * 60)

The gallery link can stay a random token, just store it on the booking so you can revoke or regenerate it per couple.

Comment
Bucket says public, and there's an anon select policy on storage.objects that the template added. So they could be listed. Ugh. yuki_builds
Drop that policy first, that's the urgent one. Signed URLs can follow tomorrow. mo_saleh
Policy dropped, listing returns nothing now. Working on the signed URLs. yuki_builds