Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dist/
files.zip
.env
.env.local
app/api/local.settings.json
.claude/
design_handoff_workout_lens/
design_handoff_tilpass_appen/
Expand Down
2 changes: 1 addition & 1 deletion app/public/staticwebapp.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"X-Frame-Options": "DENY",
"Referrer-Policy": "strict-origin-when-cross-origin",
"Permissions-Policy": "camera=(), microphone=(), geolocation=()",
"Content-Security-Policy": "default-src 'self'; script-src 'self' 'sha256-S1NwxpfinBiP8uiGmiz+HYOp4lnKrfbe0hf7PcCP3Nk='; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self'; connect-src 'self' https://*.supabase.co; object-src 'none'; base-uri 'self'; form-action 'self'"
"Content-Security-Policy": "default-src 'self'; script-src 'self' 'sha256-S1NwxpfinBiP8uiGmiz+HYOp4lnKrfbe0hf7PcCP3Nk='; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self'; connect-src 'self' https://kyolnraqudwrjjbtxhwx.supabase.co; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'"
},
"platform": {
"apiRuntime": "node:22"
Expand Down
17 changes: 17 additions & 0 deletions supabase/migrations/20260515_security_quick_wins.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- Revoke direct RPC access to handle_new_user().
-- This is an auth trigger that should only fire internally on user creation,
-- never be callable via /rest/v1/rpc/ by anon or authenticated roles.
REVOKE EXECUTE ON FUNCTION public.handle_new_user() FROM anon;
REVOKE EXECUTE ON FUNCTION public.handle_new_user() FROM authenticated;

-- Fix mutable search_path on all three stored functions.
-- Without SET search_path, a privileged attacker could shadow public schema
-- tables and redirect writes to malicious objects.
ALTER FUNCTION public.replace_template_exercises(p_template_id uuid, p_exercises jsonb)
SET search_path = public;

ALTER FUNCTION public.save_session(p_gym_calendar_id uuid, p_session_date date, p_image_url text, p_notes text, p_training_group_id uuid, p_exercises jsonb, p_replace boolean)
SET search_path = public;

ALTER FUNCTION public.update_session(p_session_id uuid, p_gym_calendar_id uuid, p_exercises jsonb, p_replace boolean)
SET search_path = public;
Loading