Hard-Coded Session Secrets in Source Code
Express applications configure express-session middleware with session secrets directly embedded in application code: app.use(session({secret: 'mySecretKey'})) or app.use(session({secret: 'keyboard cat'})). These hard-coded secrets are visible to anyone with access to the source code, remain constant across deployments, and enable attackers who obtain the secret to forge valid session cookies signed with the same HMAC key. Hard-coded secrets in JavaScript files are particularly vulnerable as they're transmitted to clients in build artifacts, visible in error stack traces, and exposed through source maps.