Skip to content
Account takeover Write-up Beginner

Privilege Escalation via Session Fixation Leading to Session Hija

The application failed to regenerate session identifiers after login, allowing an attacker to fix a session ID and later reuse it to hijack an authenticated session. This enabled privilege escalation to administrative access without valid credentials.

Vivekbhatt Sec Follow

Published on medium.com

During a recent web application security assessment, I identified a critical flaw in the application’s session management mechanism that enabled privilege escalation without requiring valid user credentials. The vulnerability originated from improper session lifecycle handling -specifically, the failure to regenerate…

Vivekbhatt Sec, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application did not regenerate the session identifier after successful authentication, so a pre-authentication session token remained valid and could be reused.

Impact

An attacker could reuse a fixed session to gain full administrative access and perform sensitive operations, leading to account takeover and privilege escalation.

What the attacker needed

Victim logs in via attacker link; attacker can set or know session ID; no session regeneration on login

The fix

The application should regenerate the session ID immediately after login, invalidate the old session, and issue a new secure token.

How it was found

  1. Capture the session cookie issued before authentication.
  2. Log in and observe that the session cookie does not change.
  3. Import the captured session cookie into a separate browser context.
  4. Use the imported session to access protected resources and admin functionality.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When you log in, a website gives your browser a temporary ID (a session cookie) so it remembers who you are. If the site does not give you a new ID after login, an attacker who knows or sets your old ID can use it to pretend to be you. This is called session fixation.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.