Use this when attackers may steal or reuse session tokens.
Session Hijacking
Session hijacking takes over a user's authenticated session by stealing or predicting its session token, through XSS, sniffing or malware. Use HTTPS, Secure and HttpOnly cookies and regenerate session IDs at login.
1. Session hijacking steals session tokens (XSS, infostealers, MITM).
2. HttpOnly/Secure cookies, TLS.
3. Short sessions, rotation.
4. Detect token reuse from new locations.
5. Revoke sessions on compromise.
stolen token → reused → detected/revoked
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Methods and defences Narrow the fault
| Method | Defence |
|---|---|
| Stealing cookies via XSS | HttpOnly cookies, CSP, output encoding |
| Sniffing on networks | HTTPS everywhere, HSTS, Secure cookies |
| Adversary-in-the-middle phishing (Evilginx) | Phishing-resistant MFA, token binding, conditional access |
| Session fixation | New session ID after login |
| Info-stealer malware exporting browser cookies | EDR, short session lifetimes, re-auth for sensitive actions |
Step 2 Common mistakes Narrow the fault
- Session cookies without Secure/HttpOnly/SameSite.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- XSS and sniffing steal session cookies.
- Secure, HttpOnly and SameSite cookies reduce risk.
- Regenerate session IDs at login.
- Session token rotation on login — fixation defence
- Secure/HttpOnly/SameSite cookies — protection
- Token binding to device/IP risk signals — detection
ReferenceWhy it matters1 section · depth on demand
How it works
Session hijacking takes over an authenticated session by stealing or guessing the session token — via XSS, network sniffing on unencrypted connections, malware stealing browser cookies, or session fixation — so the attacker is treated as the logged-in user.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Common Attacks → Session Hijacking. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://attack.mitre.org/techniques/enterprise/ · confidence 94%