Session fixation meaning, in plain words

Session fixation plants a known session ID before login. Why the attack starts before authentication, and the fix IPA calls the root solution for preventing it.

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

Session fixation plants a known session ID before a user logs in, so the attacker already holds the token when the user authenticates. IPA describes it as a problem that occurs when an attacker prepares a session ID in advance, delivers it to the user by some means, and the user logs in while that ID is still active. The term in English is session fixation.

How does session fixation work?

Imagine checking into a hotel where the front desk accepts a room number you wrote yourself, never replaces it with an official one, and completes check-in with the number you supplied. Anyone with a copy of that same number can then walk into your room. The room number in this scenario is the session ID, which is the identifier the site uses to track who is logged in.

OWASP explains that the attack targets web applications that assign a session ID before login and continue using the same ID after the user authenticates, rather than issuing a fresh one. The attack starts before the user logs in, which is what distinguishes it from session hijacking, where an already-established post-login session is stolen.

CWE-384 explains the root cause as failing to invalidate the existing session ID when a new authenticated session begins. The full picture of session management weaknesses is covered on the session management page.

Why does session fixation matter?

IPA explains that a successful attacker can use the prepared session ID to access the site as the victim. The problem applies to any site that has a login function, regardless of the type of organization.

IPA identifies the root solution as starting a new session ID the moment login succeeds. The ID issued before login must not carry over to the authenticated session. IPA also describes an alternative: issuing a separate secret at successful login, distinct from the session ID, and verifying it on every page transition. IPA lists the presence of other vulnerabilities such as XSS in the application as one of the conditions that allow an attacker to deliver the prepared ID to the user.

The free URL check shows how your login-area configuration looks from outside. For a review of your member-site implementation, contact us.

Related terms

  • Session hijacking: taking over a login session that was established after authentication.
  • Cross-site scripting (XSS): a technique that runs unauthorized code in the visitor's browser, which can be used to deliver a fixed ID.

Frequently asked questions

How do you prevent session fixation?

IPA identifies the root solution as starting a new session ID the moment login succeeds. The ID issued before login must not carry over to the authenticated session.

How is this different from session hijacking?

According to OWASP, session fixation starts before login. Session hijacking, by contrast, steals a session that was already established after login.

Next step

The full picture of session management weaknesses is covered on the session management page. The free URL check shows how your login configuration looks from outside. For a review of your member-site implementation, contact us.

Frequently asked questions

How do you prevent session fixation?

IPA identifies the root solution as starting a new session ID the moment login succeeds. The ID issued before login must not carry over to the authenticated session.

How is this different from session hijacking?

According to OWASP, session fixation starts before login. Session hijacking, by contrast, steals a session that was already established after login.

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.