Prevents directory traversal in Supabase Storage via path validation functions and storage RLS.
77
97%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Prevents directory traversal in Supabase Storage via path validation functions and storage RLS.
This tile enforces tenant-isolated file storage by creating a Postgres validation function (storage.validate_path) and attaching RLS policies to storage.objects. Every file operation is scoped to the authenticated user's tenant prefix, blocking traversal attacks at the database level.
storage.validate_path(path text, expected_tenant_id uuid) RETURNS boolean.., ./, or //.expected_tenant_id.SECURITY DEFINER with search_path = storage, public.| Operation | Condition |
|---|---|
| INSERT | storage.validate_path(name, auth.uid()) = true |
| SELECT | starts_with(name, auth.uid()::text || '/') |
| DELETE | starts_with(name, auth.uid()::text || '/') |
All paths MUST follow: {tenant_id}/{category}/{filename}
storage schema MUST be enabled on the target project.