Session Fixation
Jump to:
Summary
Session Fixation is a web application attack where an attacker tricks a user into using a known session ID, allowing the attacker to hijack the user’s authenticated session and gain unauthorized access.
Key Characteristics
- Exploits the session management mechanism by setting or forcing a session ID before user authentication.
- Allows attackers to take over a valid user session without needing to steal credentials.
- Commonly targets web applications that do not regenerate session IDs after login.
- Often involves sending a crafted URL or link containing the fixed session ID to the victim.
- Can lead to unauthorized access, data theft, and privilege escalation.
Defensive Controls
- Regenerate session IDs immediately after user authentication to prevent fixation.
- Use secure, random, and unpredictable session identifiers.
- Implement proper session expiration and invalidation mechanisms.
- Employ secure cookie attributes such as HttpOnly, Secure, and SameSite.
- Validate and restrict session ID acceptance only from legitimate sources.
Related Security Solutions
Web Application Firewalls (WAFs) can help detect and block suspicious session-related activities. Secure coding practices and session management libraries/frameworks provide built-in protections against session fixation. Security testing tools and vulnerability scanners can identify session fixation weaknesses during application assessments.
More in Application Attacks