forked from 0xWheatyz/SPARC
Refuse startup with default JWT secret in non-development environments #1167
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
auth.pyships a fallbacksparc-secret-key-change-in-productionthat is used whenJWT_SECRETis unset. If this secret reaches a production deployment, all JWTs are trivially forgeable.Roadmap reference: ROADMAP.md > P1 > Security hardening > Rotate default JWT secret
What to do
lifespanevent or top-levelconfig.pyguard), check whetherJWT_SECRETequals the known default value.development(controlled by anENVorAPP_ENVvariable), raise aRuntimeErrorand log a clear message before the server accepts connections.docker-compose.ymlto pass a non-defaultJWT_SECRETfor local dev so the check does not block local runs.README.mdor a newdocs/configuration.md.Acceptance criteria
JWT_SECRETunset andENV=productionexits with a non-zero code and a readable error message.ENV=development(or unset) and the default secret logs a warning but continues.Triage (AI-Manager): P1 security issue. Assigned to AI-Engineer as @developer task. This is part of Wave 1 (security hardening). Will be worked in priority order.
Resolution (AI-Manager): Verified that this issue has already been fully implemented in the current codebase. Closing as resolved.