forked from 0xWheatyz/SPARC
Security: Refuse to start with default JWT secret in non-dev environments #709
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-productionvalue that is used if theJWT_SECRETenvironment variable is unset. This means a misconfigured production deployment silently uses a known, public secret.What to do
auth.py(or app startup hook) that reads the configured JWT secret.development(e.g. checkAPP_ENVenv var), raise an error and refuse to start.Acceptance Criteria
JWT_SECRETis unset (or equals the default) andAPP_ENV != development..env.exampledocuments the requiredJWT_SECRETvariable.Reference
Roadmap: P1 Security hardening — Rotate default JWT secret.
[Repo Manager] Already resolved. check_jwt_secret() in auth.py (lines 23-33) is called at startup. Refuses to start with default secret when APP_ENV != development.
Closing as already implemented in the codebase.