forked from 0xWheatyz/SPARC
Add startup check to refuse default JWT secret in non-dev environments #39
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?
Problem
auth.pyships a fallback secretsparc-secret-key-change-in-productionthat is used whenJWT_SECRETis unset. If this default is left in place in a production deployment, all issued tokens are trivially forgeable.Task
__init__) that detects when the configured JWT secret matches the known default value.ENV != "development"or similar), raise a fatal error and refuse to start..env.exampleor documentation to clearly indicateJWT_SECRETmust be set.Acceptance Criteria
ENV=productioncauses an immediate startup failure with a clear error message.ENV=developmentonly emits a warning (does not block startup).References
Roadmap: P1 -- Security hardening -- Rotate default JWT secret.
Closing: Already implemented in PR #27 (feat(security): JWT startup guard, configurable CORS, externalize DB creds). config.py contains the startup check that refuses the default JWT secret in non-development environments.