[LOW] Enforce JWT_SECRET at startup - remove insecure fallback #46

Closed
opened 2026-06-09 00:03:13 +00:00 by Mark · 0 comments
Owner

Location: backend/src/auth.ts:6-14

Problem: JWT fallback secret your-secret-key-change-in-production allows the app to start insecurely without explicit misconfiguration detection.

Impact: App runs with trivially guessable signing key in production if env var is missing.

Fix:

if (!process.env.JWT_SECRET) {
  throw new Error("JWT_SECRET is required");
}

Effort: ~5 mins

**Location:** `backend/src/auth.ts:6-14` **Problem:** JWT fallback secret `your-secret-key-change-in-production` allows the app to start insecurely without explicit misconfiguration detection. **Impact:** App runs with trivially guessable signing key in production if env var is missing. **Fix:** ```ts if (!process.env.JWT_SECRET) { throw new Error("JWT_SECRET is required"); } ``` **Effort:** ~5 mins
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/subvault#46
No description provided.