Authentication Failures
Login, sessions or password reset can be bypassed or hijacked.
What it is
Authentication proves who a user is. It fails when passwords are weak, sessions live forever, session ids are reused after login, or reset links never expire.
What can happen
- Credential stuffing with passwords leaked from other sites.
- Session fixation: the attacker sets the session id before the victim logs in.
- Stolen cookies that work for months.
Example: Session fixation
// Keeps the SAME session id from before login.
req.session.userId = user.id;
res.json({ user });// New id after login: an id planted earlier becomes useless.
req.session.regenerate((err) => {
if (err) return next(err);
req.session.userId = user.id;
res.json({ user });
});Also set the cookie as httpOnly, Secure and SameSite, and give it a maxAge.
How to prevent it
- Regenerate the session on login. Destroy it on logout.
- Minimum password length, and check against leaked-password lists.
- Same error for "wrong email" and "wrong password".
- Short-lived, single-use reset tokens. Offer MFA where you can.
What CrimsonScan checks
Partly detectedThe heavy scan checks session cookie flags (HttpOnly, Secure, SameSite) and login forms sent over HTTP. Logic bugs such as fixation need a logged-in test.