Summary
The revalidate endpoint accepts a default fallback secret. Review handlers similarly use env-or-default patterns.
Affected area
src/app/api/revalidate/route.ts
- Any other API route with fallbacks
Steps to reproduce / impact
Lead to spoofed webhooks, unauthorized cache invalidations, possible denial of cache for the entire app.
Expected behaviour
Adopt a fail-closed env-config helper that throws on missing required values in NODE_ENV === 'production'.
Acceptance criteria
Summary
The revalidate endpoint accepts a default fallback secret. Review handlers similarly use env-or-default patterns.
Affected area
src/app/api/revalidate/route.tsSteps to reproduce / impact
Lead to spoofed webhooks, unauthorized cache invalidations, possible denial of cache for the entire app.
Expected behaviour
Adopt a fail-closed env-config helper that throws on missing required values in
NODE_ENV === 'production'.Acceptance criteria
requireEnvhelper used bysrc/app/api/**.