You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Harden security: per-user sort, proxy-aware rate limit, drop dev bypass
Addresses findings from a self-review of the codebase:
- clientIP only trusts X-Forwarded-For when RemoteAddr is loopback, so the
rate limiter buckets per real client behind Caddy without becoming
spoofable on a direct-to-Go deployment.
- Remove DEV_USER_EMAIL OAuth bypass entirely. Local dev now uses real
Google OAuth like prod.
- exercises.sort_order is no longer global. New user_exercise_sort_order
table holds per-user overrides; ListExercisesForUser falls back to the
seeded default. /settings/reorder writes per-user rows scoped to the
caller, so one user can no longer reorder everyone else's home page.
- Cap in-flight contact-email goroutines with a 2-slot semaphore so a
flood can't fan out enough concurrent SMTP sends to exhaust fds or trip
Gmail's per-account rate limit.
- Add defence-in-depth user_id WHERE clauses to UpdateSetActualReps,
UpdateSetsWeightForExercise, and UpsertWalkingSession (handlers already
verify ownership; this catches future regressions at the SQL layer).
- Log DeleteSession errors on logout instead of swallowing them.
- Pin appleboy/scp-action and appleboy/ssh-action to commit SHAs so a
retagged release can't grab the deploy SSH key.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments