CAPECattack pattern

CAPEC-60 Reusing Session IDs (aka Session Replay)

High Official page ↗
Abstraction
Detailed
Status
Draft
Likelihood of attack
High
Typical severity
High
CAPEC version
3.9

Description

This attack targets the reuse of valid session ID to spoof the target system in order to gain privileges. The attacker tries to reuse a stolen session ID used previously during a transaction to perform spoofing and session hijacking. Another name for this type of attack is Session Replay.

Execution flow

1. [Explore] The attacker interacts with the target host and finds that session IDs are used to authenticate users. 2. [Explore] The attacker steals a session ID from a valid user. 3. [Exploit] The attacker tries to use the stolen session ID to gain access to the system with the privileges of the session ID's original owner.

Prerequisites

• The target host uses session IDs to keep track of the users. • Session IDs are used to control access to resources. • The session IDs used by the target host are not well protected from session theft.

Skills required

• [Low] If an attacker can steal a valid session ID, they can then try to be authenticated with that stolen session ID. • [Medium] More sophisticated attack can be used to hijack a valid session from a user and spoof a legitimate user by reusing their valid session ID.

Consequences

• Confidentiality, Access Control, Authorization: Gain Privileges

Mitigations

• Always invalidate a session ID after the user logout. • Setup a session time out for the session IDs. • Protect the communication between the client and server. For instance it is best practice to use SSL to mitigate adversary in the middle attacks (CAPEC-94). • Do not code send session ID with GET method, otherwise the session ID will be copied to the URL. In general avoid writing session IDs in the URLs. URLs can get logged in log files, which are vulnerable to an attacker. • Encrypt the session data associated with the session ID. • Use multifactor authentication.

Related

Att&ck technique · MITRE ATT&CK (2)

  • T1134.001 Token Impersonation/Theft sub-technique
  • T1550.004 Web Session Cookie sub-technique

Child of · CAPEC (1)

Weakness · CWE (10)

  • CWE-200 Exposure of Sensitive Information to an Unauthorized Actor weakness
  • CWE-285 Improper Authorization weakness
  • CWE-290 Authentication Bypass by Spoofing weakness
  • CWE-294 Authentication Bypass by Capture-replay weakness
  • CWE-346 Origin Validation Error weakness
  • CWE-384 Session Fixation weakness
  • CWE-488 Exposure of Data Element to Wrong Session weakness
  • CWE-539 Use of Persistent Cookies Containing Sensitive Information weakness
  • CWE-664 Improper Control of a Resource Through its Lifetime weakness
  • CWE-732 Incorrect Permission Assignment for Critical Resource weakness

Referenced by CWE · attack pattern (10)

  • CWE-200 Exposure of Sensitive Information to an Unauthorized Actor weakness
  • CWE-285 Improper Authorization weakness
  • CWE-290 Authentication Bypass by Spoofing weakness
  • CWE-294 Authentication Bypass by Capture-replay weakness
  • CWE-346 Origin Validation Error weakness
  • CWE-384 Session Fixation weakness
  • CWE-488 Exposure of Data Element to Wrong Session weakness
  • CWE-539 Use of Persistent Cookies Containing Sensitive Information weakness
  • CWE-664 Improper Control of a Resource Through its Lifetime weakness
  • CWE-732 Incorrect Permission Assignment for Critical Resource weakness