Skip to content

security: replace env-or-default patterns with fail-closed helpers #444

Description

@nanaf6203-bit

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

  • Centralised requireEnv helper used by src/app/api/**.
  • CI test asserting prod build fails on missing env.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programdevopsCI/CD, build, scripts, infrapriority/p1P1 — high priority, fix soonsecuritySecurity issue or hardening opportunity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions