Skip to content

bug: hardcoded fallback secret in REVALIDATE_WEBHOOK_SECRET #421

Description

@nanaf6203-bit

Summary

src/app/api/revalidate/route.ts defines WEBHOOK_SECRET as a fallback string literal that ships with the source code.

Affected area

  • src/app/api/revalidate/route.ts line 7: const WEBHOOK_SECRET = process.env.REVALIDATE_WEBHOOK_SECRET || 'your-webhook-secret';

Steps to reproduce / impact

If the env var is misconfigured or absent in production, the route will silently accept all requests signed with the literal default string. This renders the HMAC verification useless and opens the revalidation endpoint to spoofing.

Expected behaviour

Throw at startup if REVALIDATE_WEBHOOK_SECRET is missing in production. Provide a clear error message to developers running locally.

Acceptance criteria

  • Remove the default fallback secret.
  • Throw a descriptive error on missing secret.
  • Document required env vars in .env.example and README.md.
  • Add a test confirming the route rejects requests when the secret is missing.

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 programbugSomething isn't working correctlypriority/p0P0 — drop everything, ship hotfixsecuritySecurity issue or hardening opportunity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions