githubEdit

Session fixation

Session fixation attacks force a user to use a session ID known to the attacker, enabling account takeover after the victim authenticates.

How It Works

  1. Attacker obtains a valid session ID from the target site

  2. Attacker tricks victim into using that session ID

  3. Victim authenticates with the fixed session

  4. Attacker uses the same session ID to access victim's account

Testing Methodology

Basic Test

1. Open target.com/login (Attacker browser)
2. Note the SESSION cookie value: abc123
3. Open target.com/login in incognito (Victim simulation)
4. Set cookie to attacker's value: abc123
5. Login as victim in incognito tab
6. Refresh attacker's browser
7. If logged in as victim → VULNERABLE

Check if Session Changes on Login

Attack Vectors

Via URL Parameter

Via Meta Tag Injection

Via Cross-Site Cooking

Indicators of Vulnerability

Indicator
Status

Session ID unchanged after login

❌ Vulnerable

Session accepted via URL parameter

❌ Vulnerable

No HttpOnly flag on session cookie

⚠️ Risk factor

Session cookie domain too broad

⚠️ Risk factor

Long session timeout

⚠️ Risk factor

Verification Commands

Secure Implementation (What to Look For)

Last updated

Was this helpful?