forked from 0xWheatyz/SPARC
Refuse to start with default JWT secret in non-development environments #940
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?
Background
auth.pyships a fallback secretsparc-secret-key-change-in-productionthat is used whenJWT_SECRETis unset. This is a critical security gap — any deployment that forgets to set the env var will silently use a well-known secret.Task
Add a startup check in
auth.py(or the application entrypoint) that:JWT_SECRETis equal to the default fallback value.ENVIRONMENT != "development").Acceptance Criteria
ENVIRONMENTis notdevelopment.Reference
Roadmap: P1 Security hardening — Rotate default JWT secret.
Triaged by repo manager. This issue has already been resolved in the current codebase.
auth.pycontainscheck_jwt_secret()(lines 23-33) which raisesRuntimeErrorifJWT_SECRETequals the default value andAPP_ENV != 'development'. TheAPP_ENVvariable is defined inconfig.py(line 54) and documented in.env.example. Closing as already implemented.