Session management flaws meaning, in plain words

Session management flaws let attackers take over a logged-in session. How hijacking and fixation work, per IPA, OWASP and MITRE CWE, and cookie checks.

Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated

Session management flaws are weaknesses in managing the login state, which let it be taken over. A website remembers who has logged in with a session ID, a string that works as a mark of being logged in. IPA explains that if issuing or managing this ID is flawed, an attacker may impersonate a user and access the site.

How do session management flaws work?

Think of the claim ticket you get when you leave luggage at a cloakroom. If the ticket numbers are easy to guess, or you are handed someone else's ticket, another person can walk off with the luggage.

According to OWASP, after login the session ID stands in for the login. If an attacker can obtain a valid ID, guess one, or fix one, they can impersonate the user. IPA separates the case of stealing the ID, called session hijacking, from the case of making the user use an ID the attacker prepared, called session ID fixation.

For fixation, MITRE CWE likewise names the cause as not invalidating an existing session ID at login. If the same ID continues before and after login, someone who knew it beforehand can simply get in. How to defend is organized on the session management vulnerability page.

Why do session management flaws matter?

Even with a strong password and two-step verification, if the session ID after login is taken, operations as that person are allowed. The problem is that member information, orders, and admin screen operations can be reached with the person's own rights.

IPA gives four root solutions: make the ID hard to guess, keep the ID out of the URL, add the Secure attribute to cookies over HTTPS, and start a new session after a successful login and invalidate the old ID.

OWASP adds the HttpOnly attribute, which stops JavaScript from reading the cookie. It also lists limiting submissions from other sites with the SameSite attribute, and ending the session after a fixed time. At logout the server-side session is invalidated.

For home-made login features and old plugins, check these settings. A look at your cookies from outside is possible with the free URL check.

Related terms

  • CSRF: an attack that makes a logged-in user perform an operation they did not intend
  • XSS: a weakness that lets someone insert unauthorized commands through input fields and the like
  • HSTS: a setting that tells the browser to use encrypted connections only
  • Broken access control: a flaw where people see data they should not be able to see

Frequently asked questions

How are session hijacking and session fixation different?

Session hijacking steals the session ID of a logged-in person and impersonates them. Fixation makes the user use an ID the attacker prepared, then impersonates them with the same ID after login. IPA lists both.

If I press the logout button, does the session end safely?

It does if the server ends it. OWASP explains that deleting the cookie in the browser is not enough, and that the session must be invalidated on the server side.

Next step

How to protect the login state is organized on the session management vulnerability page. The free URL check shows only what is visible from outside, such as how your site's cookies look, and for a review of your login feature, contact us.

Frequently asked questions

How are session hijacking and session fixation different?

Session hijacking steals the session ID of a logged-in person and impersonates them. Fixation makes the user use an ID the attacker prepared, then impersonates them with the same ID after login. IPA lists both.

If I press the logout button, does the session end safely?

It does if the server ends it. OWASP explains that deleting the cookie in the browser is not enough, and that the session must be invalidated on the server side.

See what an attacker can see, today

The free URL check returns a grade in under a minute. For costs and next steps, book a free consultation.