Overview
AuthService.generateAccessToken()/generateRefreshToken() and JwtStrategy's constructor all read the signing secret via configService.get<string>('JWT_SECRET', 'secretKey') / 'refreshSecretKey' (backend/src/auth/auth.service.ts, backend/src/auth/strategies/jwt.strategy.ts). If JWT_SECRET/JWT_REFRESH_SECRET is ever unset — a misconfigured environment, not just local dev — the app silently signs and verifies tokens with these literal strings from the source code, which anyone who has read the repo can forge.
Tasks
Acceptance Criteria
Notes for Contributors
Comment below to be assigned.
Overview
AuthService.generateAccessToken()/generateRefreshToken()andJwtStrategy's constructor all read the signing secret viaconfigService.get<string>('JWT_SECRET', 'secretKey')/'refreshSecretKey'(backend/src/auth/auth.service.ts,backend/src/auth/strategies/jwt.strategy.ts). IfJWT_SECRET/JWT_REFRESH_SECRETis ever unset — a misconfigured environment, not just local dev — the app silently signs and verifies tokens with these literal strings from the source code, which anyone who has read the repo can forge.Tasks
main.tsor aConfigModulevalidation schema) ifJWT_SECRETorJWT_REFRESH_SECRETis unset or shorter than a safe minimum length.'secretKey'/'refreshSecretKey'literal fallbacks fromauth.service.tsandjwt.strategy.ts.backend/.env.examplewith a comment that there is no default.Acceptance Criteria
JWT_SECRETunset throws instead of falling back to a guessable string.Notes for Contributors
Comment below to be assigned.