Issue Found
After reviewing the entire codebase, I found Express session secret is hardcoded in backend/index.js:40:
app.use(
session({
secret: "keyboard cat",
resave: false,
saveUninitialized: false,
...
})
);
Why This matters
"keyboard cat" is the default example from express-session docs. Anyone who reads this repo's code can:
- Forge session cookies — Craft a valid session for any user including admins
- Session hijacking — The same cookie works across all instances
- Bypass authentication — Since session data is signed with a known secret, an attacker can create a session for any user
How to fix
- Generate a cryptographically random secret:
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
- Add it to
.env as SESSION_SECRET=<random-value>
- Update the code:
secret: process.env.SESSION_SECRET,
- Regenerate the secret before deploying to production
Issue Found
After reviewing the entire codebase, I found Express session secret is hardcoded in
backend/index.js:40:Why This matters
"keyboard cat"is the default example from express-session docs. Anyone who reads this repo's code can:How to fix
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))".envasSESSION_SECRET=<random-value>