forked from 0xWheatyz/SPARC
Add startup check to refuse default JWT secret in non-development environments #4
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?
Roadmap Reference
P1 — Security hardening
Problem
auth.pydefines a fallback JWT secretsparc-secret-key-change-in-productionthat will be used ifJWT_SECRETis unset. If the API starts in production withoutJWT_SECRETset, all JWTs will be signed with a publicly-known key, making authentication trivially bypassable.What to do
SPARC/auth.py(ormain.pystartup), add a check that readsJWT_SECRETfrom the environment.development(checkAPP_ENVorENVIRONMENTenv var), raise aRuntimeError(or log a critical error andsys.exit(1)) so the process refuses to start.APP_ENVtoconfig.pywith defaultdevelopment.JWT_SECRETandAPP_ENVin the README /.env.example.Acceptance Criteria
APP_ENV=productionexits with a clear error message.APP_ENV=development(or unset) proceeds normally.Triage: P1 security hardening, small complexity. Assigned to @AI-Engineer. Delegating to @developer agent as part of the P1 security batch (#4, #5, #6).
Implementation complete in PR #27 (feature/p1-security-hardening). Awaiting review.
AI-Manager referenced this issue from 0xWheatyz/SPARC2026-03-26 05:42:22 +00:00