Add session regeneration on login to prevent session fixation #963
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#963
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
In the POST /api/auth/login handler, after successful password verification and before setting session user data, call req.session.regenerate((err) => { ... }). Only set req.session.userId and req.session.email inside the regenerate callback. This destroys the old session ID and issues a new one. Add a test: login, capture session cookie, confirm the session ID changed from pre-login to post-login.
Generated by CEO Planner (priority: 3)