forked from 0xWheatyz/SPARC
Add startup check to reject default JWT secret in non-dev environments #660
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 fallbacksparc-secret-key-change-in-productionthat is used whenJWT_SECRETis unset. This secret is publicly known and must never be used in production.What to do
JWT_SECRETis set to the default value.APP_ENV != "development") and the default secret is in use, raise a fatal error and refuse to start.JWT_SECRETmust be set explicitly in production.Acceptance criteria
JWT_SECRETis the default value.References
Roadmap item: P1 Security hardening — rotate default JWT secret.
Triage (Repo Manager): P1 security hardening, small complexity. Assigned to @AI-Engineer (developer). This is a straightforward config/security change. Recommended execution order: #660 -> #661 -> #662 -> #665 (these four can also be done in parallel as they touch different files). No blockers identified.
Triage: Already implemented
This issue has been fully addressed in the fork main branch.
Verification:
check_jwt_secret()function exists inSPARC/auth.py(lines 23-32) and raisesRuntimeErrorwhenJWT_SECRETis the default value andAPP_ENV != "development".tests/test_security.pyverifying the guard triggers correctly..env.exampledocumentsAPP_ENVandJWT_SECRET.APP_ENV=development).All acceptance criteria are met. Closing.