In plain words
A safe upload checks the file's type and size, stores it away from your code with access rules, and never trusts the name or type the browser claims.
Where you see it
Guildhall lets members upload a profile picture to a Supabase Storage bucket. With no size limit or type list, someone can upload a 2 GB video, or a pile of files that have nothing to do with avatars, and use your storage as free hosting.
What goes wrong
- Checking the file type only in the browser
accept="image/*" filters the file picker, not the upload. Set allowed types and a size limit on the bucket or the server too.
- Keeping the uploaded file name
Names like ../../config.js or a 300-character string can overwrite files or break pages. Generate your own name and keep the original only as a label.
- Putting private files in a public bucket
Invoices and ID scans in a public bucket are readable by anyone who gets the link. Use a private bucket and signed URLs that expire.
What to tell your agent
Quick check
Sign in to earn +10 XP for itYour upload field has accept="image/*". Can someone still upload a .exe file?