Skip to content

fix: validate SESSION_SECRET in production to prevent fallback-to-insecure - #95

Open
Inkcha wants to merge 1 commit into
profullstack:masterfrom
Inkcha:fix/session-secret-validation
Open

fix: validate SESSION_SECRET in production to prevent fallback-to-insecure#95
Inkcha wants to merge 1 commit into
profullstack:masterfrom
Inkcha:fix/session-secret-validation

Conversation

@Inkcha

@Inkcha Inkcha commented Jul 27, 2026

Copy link
Copy Markdown

Description

Prevents the insecure default \SESSION_SECRET\ from reaching production. If the env var is missing when \NODE_ENV=production, the app now throws at startup instead of silently using a hardcoded dev fallback.

Changes

  • \�pps/web/lib/env.ts: Wrapped \sessionSecret\ in an IIFE that validates the env var in production, preserving the dev fallback for local development.

Related

Fixes the HIGH severity issue reported in #88

Testing

  • Local dev: continues to work with the dev fallback
  • Production: will fail to start if \SESSION_SECRET\ is not set

…ecure

The sessionSecret defaulted to a hardcoded dev-only value if
SESSION_SECRET env var was not set. In production this means
anyone knowing the default can forge session tokens.

This change throws a startup error in production if SESSION_SECRET
is missing, while preserving the dev fallback for local development.

Fixes the HIGH severity issue reported in profullstack#88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant