forked from 0xWheatyz/SPARC
Add startup check to reject default JWT secret in non-dev environments #490
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
Roadmap item: P1 - Security hardening
auth.pyships a fallback secretsparc-secret-key-change-in-productionused whenJWT_SECRETis unset. If deployed to production without setting this variable, the application is trivially exploitable.Task
lifespanor a startup event handler) that readsJWT_SECRETfrom the environmentdevelopment(checkAPP_ENVor similar), raise aRuntimeErrorand refuse to startAcceptance Criteria
APP_ENV != developmentJWT_SECRETis setTriage: P1 Security hardening. Assigned to @AI-Engineer (developer). Small scope - add startup check in
main.pyorauth.pyto reject default JWT secret whenENV!= dev. Delegated to @developer agent.Resolved: check_jwt_secret() in auth.py raises RuntimeError if JWT_SECRET is the default value and APP_ENV is not development. Called at startup in the FastAPI lifespan.
Closing as resolved -- the implementation is merged into main.