Hardcoded default COOKIE_SECRET with no production guard #18

Open
opened 2026-07-25 11:16:33 +00:00 by GKaszewski · 0 comments
Owner

Severity: Critical

crates/infra-wiring/src/lib.rs has a hardcoded default COOKIE_SECRET in source code with no production guard. The JWT adapter correctly rejects weak secrets in production mode, but the cookie secret has no equivalent check.

An operator who forgets to set COOKIE_SECRET gets a readable default baked into the binary. Add a production-mode check that panics on startup if the default is used.

**Severity: Critical** `crates/infra-wiring/src/lib.rs` has a hardcoded default `COOKIE_SECRET` in source code with no production guard. The JWT adapter correctly rejects weak secrets in production mode, but the cookie secret has no equivalent check. An operator who forgets to set `COOKIE_SECRET` gets a readable default baked into the binary. Add a production-mode check that panics on startup if the default is used.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/k-tv#18