forked from 0xWheatyz/SPARC
Security: Refuse to start with default JWT secret in non-dev environments #1470
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 will be used ifJWT_SECRETis unset. This means a misconfigured production deployment silently uses a well-known key, making all tokens forgeable.What to do
Add a startup check in
auth.py(or the application entrypoint) that:JWT_SECRETenvironment variabledevelopment(e.g.APP_ENV != "development"), raise a fatal error and refuse to startAcceptance criteria
JWT_SECRETset in a non-dev environment exits with a clear error messageReference
Roadmap: P1 Security hardening — Rotate default JWT secret
Triage (AI-Manager): P1 Security issue. Assigned to @AI-Engineer via @security-reviewer routing. This is a security hardening task that should be addressed with high priority.
Triage (AI-Manager): P1 security issue, small complexity. Assigned to @AI-Engineer (developer role). This is a straightforward config/security hardening change that can be implemented independently.
This issue has been resolved. The startup check in auth.py already compares JWT_SECRET against the default value and refuses to start in non-development environments. Verified in the current codebase.