Session hijacking meaning, in plain words

Session hijacking takes over an active login session to impersonate the user. How session IDs leak, what attackers do with them, and the fixes IPA recommends.

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

Session hijacking takes over an active login session to impersonate the account holder. IPA explains that when session management has weaknesses, an attacker can obtain a logged-in user's session ID and use it to act as that person. Session ID is the identifier the site uses to track who is logged in.

How does session hijacking work?

When a user logs in, the site issues a numbered token — similar to a visitor badge — and checks that token on every subsequent request. If the token falls into the wrong hands, anyone holding it can enter without credentials. That token is the session ID.

According to OWASP, an attacker either steals the session token or guesses it. The main paths for token leakage are tokens that are easy to predict, interception of network traffic, attacks against the user's browser such as XSS, and man-in-the-middle attacks. The full range of session management weaknesses is covered on the session management page.

Why does session hijacking matter?

IPA explains that a successful attack lets the attacker perform any action the legitimate user is permitted to take. That includes unauthorized money transfers, unintended purchases, account cancellation, unauthorized changes to settings, and viewing private personal information. IPA states that any site with a login function needs attention, regardless of the type of organization or the nature of the site.

IPA lists four root fixes:

  • Use a session ID that is hard to guess.
  • Never include the session ID in a URL parameter.
  • Add the secure attribute to cookies that are transmitted over HTTPS.
  • Start a new session when login succeeds.

IPA also lists supplementary measures: not using a fixed value as the session ID, and monitoring the expiry of cookies. CAPEC recommends invalidating the session ID after logout, setting an expiry, and encrypting communications.

The free URL check shows what your login-area configuration looks like from outside. To review your member-site implementation, contact us.

Related terms

Frequently asked questions

What is the difference between session hijacking and session fixation?

OWASP explains that session fixation starts before login. Session hijacking, by contrast, steals a session that has already been established after login.

What should a site operator address first?

IPA lists four root fixes: use a session ID that is hard to guess, never put the session ID in a URL parameter, add the secure attribute to cookies used over HTTPS, and start a fresh session on successful login.

Next step

The full range of session management weaknesses is covered on the session management page. The free URL check shows what your login-area configuration looks like from outside. To review your member-site implementation, contact us.

Frequently asked questions

What is the difference between session hijacking and session fixation?

OWASP explains that session fixation starts before login. Session hijacking, by contrast, steals a session that has already been established after login.

What should a site operator address first?

IPA lists four root fixes: use a session ID that is hard to guess, never put the session ID in a URL parameter, add the secure attribute to cookies used over HTTPS, and start a fresh session on successful 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.