ΣύνδεσηΕγγραφή
A07 · 2025

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

Example: Session fixation

✕ Vulnerable
// Keeps the SAME session id from before login.
req.session.userId = user.id;
res.json({ user });
✓ Fixed
// 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

What CrimsonScan checks

Partly detected

The 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.

Read more on owasp.org ↗