wutzcalc/server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
iris da8a815677 admin: session cookie is a random per-login token, not the password itself
The session cookie value was the admin password, replayed on every
request — one sniffed request on the LAN yields the actual shared
secret, not just a session, and logout only cleared the browser's
copy since the value (the password) stays valid forever.

Mint a random token on successful login, hold valid tokens in an
in-memory Set, set that as the cookie, and delete it from the set on
logout — logout now actually revokes the session. A server restart
naturally invalidates all sessions too (fine for this single-process
deploy).

Also compare the login password with a constant-time digest
comparison instead of ===, hygiene rather than a practical fix given
the existing shared-password/no-rate-limit threat model, but a small
change while touching this code.
2026-07-29 22:15:29 +02:00
..
migrations snapshot the Pfand rate used for returns, like every other money value already is 2026-07-29 20:26:52 +02:00
src admin: session cookie is a random per-login token, not the password itself 2026-07-29 22:15:29 +02:00
package.json scaffold festival drink tracker (pnpm workspace, Fastify + SQLite, Preact tablet UI, admin) 2026-05-19 18:12:01 +02:00
tsconfig.json scaffold festival drink tracker (pnpm workspace, Fastify + SQLite, Preact tablet UI, admin) 2026-05-19 18:12:01 +02:00