Refuse to sign sessions with the committed fallback in production #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claw/session-secret-required"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SESSION_SECRETwas never set on the service, so production signed every session cookie withdevelopment-secret-change-in-production— a value committed to this repo.mint-session.mjs, also committed, mints an admin session with that exact value, so anyone who could read the source could forge an admin cookie and skip Bio-ID.The key is now resolved per call and a missing
SESSION_SECRETthrows in production instead of falling back. Local dev keeps the fallback, somint-session.mjsstill works there.verifySessionTokenalready catches, so a misconfigured deploy denies admin access rather than taking the site down.Verified:
tsc --noEmitclean. In production mode a forged dev-signed cookie is rejected, a missing secret refuses to mint, and a real secret round-trips; dev mode still mints and verifies.Ships together with setting
SESSION_SECRETas a service secret.🤖 Generated with Claude Code