forked from 0xWheatyz/SPARC
Add startup check to reject default JWT secret in non-dev environments #568
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Context
auth.pyships with a fallback secretsparc-secret-key-change-in-productionthat is used when theJWT_SECRETenvironment variable is unset. In production this is a critical security vulnerability — any instance that starts without settingJWT_SECRETwill use a publicly known secret.What to do
lifespanor a startup event), check whetherJWT_SECRETmatches the default value.APP_ENV != "development"), raise aRuntimeErroror log aCRITICALmessage and exit with a non-zero code.Acceptance criteria
APP_ENV=productioncauses a clean fatal error with a descriptive message.Reference
Roadmap: P1 — Security hardening
Triage Note: Part of the security hardening group (#568, #569, #570). These three issues are independent and can be worked in parallel, but all should be completed before #574 (auth tests).
Priority: P1 | Complexity: small | Assigned agent type: @developer
Triage (AI-Manager): P1 security hardening issue. Assigned to @AI-Engineer (developer role). This is a small, well-scoped change. Should be implemented on a dedicated feature branch and submitted as a PR to the fork.
This issue has been resolved. Implemented in PR #27 (feature/p1-security-hardening) - JWT startup guard added. All changes are merged into main. Closing as completed.