Session Replay Attacks
You'll learn: How attackers intercept and reuse valid session tokens to impersonate legitimate users without knowing their passwords.
What is a Session Replay Attack?
A session replay attack occurs when an attacker captures a valid session token (usually transmitted over the network or stolen via XSS) and later "replays" it by sending the same token to the server to gain unauthorized access. The server, seeing a valid token, grants access—even though the request comes from the attacker, not the original user.
Think of it like stealing someone's concert wristband: once you have it, you can walk in and out of the venue just like the legitimate ticket holder. The security guard sees the valid wristband and lets you through, not realizing you're not the original person.
How It Works
- Token Capture: The attacker intercepts a session token through network sniffing (if unencrypted), XSS injection, or physical access to a device
- Token Storage: The attacker saves the token for later use
- Replay: Minutes, hours, or days later, the attacker sends HTTP requests with the stolen token
- Unauthorized Access: The server validates the token and grants access to the victim's account
Unlike session hijacking (where the attacker takes over an active session immediately), replay attacks can happen long after the token was captured—as long as the session hasn't expired or been invalidated.
Real-World Risk
This attack is particularly dangerous when:
- Sessions have long timeouts
- Tokens are transmitted over unencrypted connections
- The application lacks additional verification (IP binding, device fingerprinting)
- Users don't log out properly
Key Takeaway: Session replay attacks exploit the reusability of valid session tokens; defense requires short timeouts, HTTPS encryption, proper logout mechanisms, and ideally additional context validation beyond just the token itself.