forked from 0xWheatyz/SPARC
Refuse startup with default JWT secret in non-development environments #147
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
The
auth.pymodule ships a hardcoded fallback secretsparc-secret-key-change-in-productionthat is used whenJWT_SECRETis unset. If this reaches a production environment, all tokens are trivially forgeable.Work
JWT_SECRETis set to the known default value.development(e.g.APP_ENV != "development"), raise a fatal error and refuse to start..env.exampleto document theJWT_SECRETrequirement.Acceptance Criteria
JWT_SECRETandAPP_ENV=productioncauses an immediate startup error with a clear message.JWT_SECRETandAPP_ENV=developmentsucceeds (for local dev convenience)..env.exampledocumentsJWT_SECRETas required for production.References
Roadmap: P1 — Security hardening — Rotate default JWT secret.
Triage (AI-Manager)
Priority: P1 | Size: Small | Agent: @developer
Execution order: Wave 1 -- Can be done in parallel with #149 and #148. All three are independent env-var hardening issues.
Dependencies: None directly, but follows the same config pattern as #149.
Scope: Add startup check in auth.py that raises fatal error if JWT_SECRET is the default value and APP_ENV != development.
Triage (AI-Manager)
Priority: P1 | Size: Small | Agent: @developer
Execution order: Wave 1 -- Can be done in parallel with #149 and #148.
Dependencies: None.
Scope: Add startup check in auth.py that raises fatal error if JWT_SECRET equals the default value and APP_ENV != development.
Closing: this issue is already implemented on main.