CAPEC-196 - Session Credential Falsification through Forging

An attacker creates a false but functional session credential in order to gain or usurp access to a service. Session credentials allow users to identify themselves to a service after an initial authentication without needing to resend the authentication information (usually a username and password) with every message. If an attacker is able to forge valid session credentials they may be able to bypass authentication or piggy-back off some other authenticated user's session. This attack differs from Reuse of Session IDs and Session Sidejacking attacks in that in the latter attacks an attacker uses a previous or existing credential without modification while, in a forging attack, the attacker must create their own credential, although it may be based on previously observed credentials.

Severity

Likelihood

Confidentiality

Integrity

Availability

  • Attack Methods 2
  • Injection
  • Time and State
  • Purposes 1
  • Penetration
  • Scopes 7
  • Modify files or directories
  • Integrity
  • Read files or directories
  • Confidentiality
  • Modify application data
  • Integrity
  • Read application data
  • Confidentiality
  • Execute unauthorized code or commands
  • Authorization
  • Gain privileges / assume identity
  • Non-Repudiation
  • Authorization
  • Authentication
  • Accountability
  • Bypass protection mechanism
  • Authorization
  • Access_Control

Medium level: Forge the session credential and reply the request.

The targeted application must use session credentials to identify legitimate users. Session identifiers that remains unchanged when the privilege levels change. Predictable session identifiers.

Attackers may require tools to craft messages containing their forged credentials, and ability to send HTTP request to a web application.

Step 1 - Analyze and Understand Session IDs

The attacker finds that the targeted application use session credentials to identify legitimate users..

Tecnique ID: 1 - Environment(s) env-Web

An attacker makes many anonymous connections and records the session IDs.

Tecnique ID: 2 - Environment(s) env-Web

An attacker makes authorized connections and records the session tokens or credentials.

Indicator ID: 1 - Environment(s) env-Web

Type: Positive

Valid session information

Indicator ID: 2 - Environment(s) env-Web

Type: Negative

No valid session information


Security Control ID: 1

Type: Detective

Monitor logs for unusual multiple connections from a source.


Outcome ID: 1

Type: Success

The attacker models the session ID algorithm enough to produce a compatible series or IDs, or just one match. (When IDs are predictable)



Step 1 - Create Session IDs.

Attackers craft messages containing their forged credentials in GET, POST request, HTTP headers or cookies..

Tecnique ID: 1 - Environment(s) env-Web

The attacker manipulates the HTTP request message and adds his forged session IDs in to the requests or cookies.

Indicator ID: 1 - Environment(s) env-Web

Type: Positive

Find that application uses session credentials.

Indicator ID: 2 - Environment(s) env-Web

Type: Negative

Find that application does not use session credentials.


Security Control ID: 1

Type: Detective

Detect and alert on users who provide known session IDs in their connection establishment. Since this also fits the scenario where a user's session has expired, the heuristic must be a bit smarter, perhaps looking for an unusually high number of such occurrences in a short time frame.


Outcome ID: 1

Type: Success

Victim application accepts attackers' session credentials.

Outcome ID: 2

Type: Failure

Victim application does not accept attackers' session credentials.



Step 1 - Abuse the Victim's Session Credentials

The attacker fixates falsified session ID to the victim when victim access the system. Once the victim has achieved a higher level of privilege, possibly by logging into the application, the attacker can now take over the session using the forged session identifier..

Tecnique ID: 1 - Environment(s) env-All

The attacker loads the predefined or predicted session ID into his browser and browses to protected data or functionality.

Tecnique ID: 2 - Environment(s) env-All

The attacker loads the predefined or predicted session ID into his software and utilizes functionality with the rights of the victim.

Security Control ID: 1

Type: Detective

Detect and alert on multiple simultaneous uses of the same session ID from different origins.

Security Control ID: 2

Type: Preventative

Apply appropriate input validation to filter all user-controllable input


Outcome ID: 1

Type: Success

The attacker gains access to data or functionality with the rights of the victim.



Implementation: Use session IDs that are difficult to guess or brute-force: One way for the attackers to obtain valid session IDs is by brute-forcing or guessing them. By choosing session identifiers that are sufficiently random, brute-forcing or guessing becomes very difficult.

Implementation: Regenerate and destroy session identifiers when there is a change in the level of privilege: This ensures that even though a potential victim may have followed a link with a fixated identifier, a new one is issued when the level of privilege changes.