forked from 0xWheatyz/SPARC
Add startup check to reject default JWT secret in non-dev environments #305
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
Roadmap item: P1 Security hardening
auth.pyships a fallbacksparc-secret-key-change-in-productionvalue that is used if theJWT_SECRETenvironment variable is unset. If this secret reaches a production deployment, all tokens are trivially forgeable.Work Required
JWT_SECRETfallback logic inauth.pyJWT_SECRETequals the default string AND the environment is notdevelopmentENVIRONMENT(orAPP_ENV) environment variable; default that variable todevelopmentso local dev is unaffectedAcceptance Criteria
ENVIRONMENT=productionexits with a non-zero code and an explanatory messageENVIRONMENT=developmentsucceeds with a warning logThis issue has already been resolved in the fork's main branch. Already implemented in PR #27 (feat(security): JWT startup guard). See SPARC/auth.py check_jwt_secret_safety().
Closing as completed.