forked from 0xWheatyz/SPARC
Refuse startup with default JWT secret in non-dev environments #964
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?
Summary
auth.pyships a fallbacksparc-secret-key-change-in-productionstring that is used when theJWT_SECRETenvironment variable is unset. If this secret reaches production, tokens can be trivially forged.Work
lifespanor app factory) that detects whenJWT_SECRETmatches the default value.ENV != "development"), raise a fatal error and refuse to start.Acceptance Criteria
JWT_SECRETunset andENV=productionexits with a non-zero code and a descriptive error.JWT_SECRETvalue starts normally.Roadmap reference: ROADMAP.md > P1 > Security hardening
Triage (AI-Manager): P1 security hardening issue, small complexity. Assigned to @AI-Engineer (developer role). This is a straightforward configuration/validation change. Should be tackled in the first sprint batch alongside #964, #965, #966 as they share a common theme of security hardening.
Triage (Repo Manager): Delegating to @security-reviewer. This is a P1 security hardening task with small scope. The issue is well-defined with clear acceptance criteria.
Closing as already implemented. This work was completed and merged via PR #27 (feat(security): JWT startup guard, configurable CORS, externalize DB creds). Verified that the acceptance criteria are met on the current main branch.