fix(security): scope proxy public routes to exact paths (R4)
/auth -> /auth/callback and /api/cron -> /api/cron/notifications. Both prefixes whitelisted more than the single route that needs anonymity; a future /auth/* page or /api/cron/* job would have been silently public. Verified those are the only routes under each.
This commit is contained in:
@@ -14,7 +14,9 @@ const PUBLIC_ROUTES = [
|
|||||||
'/join',
|
'/join',
|
||||||
// Public anonymous-incident status lookup by reporter token.
|
// Public anonymous-incident status lookup by reporter token.
|
||||||
'/track',
|
'/track',
|
||||||
'/auth',
|
// Only the OAuth callback is anonymous; scope to the exact route so a
|
||||||
|
// future /auth/* page is not silently public.
|
||||||
|
'/auth/callback',
|
||||||
'/api/health',
|
'/api/health',
|
||||||
// Stripe calls this unauthenticated; it is verified by the per-space
|
// Stripe calls this unauthenticated; it is verified by the per-space
|
||||||
// webhook signature, not a session. Must NOT be redirected to /login
|
// webhook signature, not a session. Must NOT be redirected to /login
|
||||||
@@ -23,7 +25,9 @@ const PUBLIC_ROUTES = [
|
|||||||
'/api/stripe/webhook',
|
'/api/stripe/webhook',
|
||||||
// The notification dispatcher is hit by the droplet's crontab (no
|
// The notification dispatcher is hit by the droplet's crontab (no
|
||||||
// session); it enforces its own CRON_SECRET shared-secret header.
|
// session); it enforces its own CRON_SECRET shared-secret header.
|
||||||
'/api/cron',
|
// Scoped to the exact route so a future /api/cron/* without its own
|
||||||
|
// secret is not exposed.
|
||||||
|
'/api/cron/notifications',
|
||||||
// Public form / waiver fill page. Only /f/[slug] lives here and must be
|
// Public form / waiver fill page. Only /f/[slug] lives here and must be
|
||||||
// reachable anonymously (the page serves only published public forms and
|
// reachable anonymously (the page serves only published public forms and
|
||||||
// submitForm enforces visibility). The /forms* management routes do NOT
|
// submitForm enforces visibility). The /forms* management routes do NOT
|
||||||
|
|||||||
Reference in New Issue
Block a user