Home > CAPEC List > CAPEC-196: Session Credential Falsification through Forging (Version 2.9)  

CAPEC-196: Session Credential Falsification through Forging

 
Session Credential Falsification through Forging
Definition in a New Window Definition in a New Window
Attack Pattern ID: 196
Abstraction: Standard
Status: Draft
Completeness: Complete
Presentation Filter:
+ Summary

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.

+ Attack Execution Flow
Explore
  1. Analyze and Understand Session IDs:

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

    Attack Step Techniques

    IDAttack Step Technique DescriptionEnvironments
    1

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

    env-Web
    2

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

    env-Web

    Indicators

    IDTypeIndicator DescriptionEnvironments
    1Positive

    Valid session information

    env-Web
    2Negative

    No valid session information

    env-Web

    Outcomes

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

    Security Controls

    IDTypeSecurity Control Description
    1Detective
    Monitor logs for unusual multiple connections from a source.
Experiment
  1. Create Session IDs.:

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

    Attack Step Techniques

    IDAttack Step Technique DescriptionEnvironments
    1

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

    env-Web

    Indicators

    IDTypeIndicator DescriptionEnvironments
    1Positive

    Find that application uses session credentials.

    env-Web
    2Negative

    Find that application does not use session credentials.

    env-Web

    Outcomes

    IDTypeOutcome Description
    1Success
    Victim application accepts attackers' session credentials.
    2Failure
    Victim application does not accept attackers' session credentials.

    Security Controls

    IDTypeSecurity Control Description
    1Detective
    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.
Exploit
  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.

    Attack Step Techniques

    IDAttack Step Technique DescriptionEnvironments
    1

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

    env-All
    2

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

    env-All

    Outcomes

    IDTypeOutcome Description
    1Success
    The attacker gains access to data or functionality with the rights of the victim.

    Security Controls

    IDTypeSecurity Control Description
    1Detective
    Detect and alert on multiple simultaneous uses of the same session ID from different origins.
    2Preventative
    Apply appropriate input validation to filter all user-controllable input
+ Attack Prerequisites
  • The targeted application must use session credentials to identify legitimate users. Session identifiers that remains unchanged when the privilege levels change. Predictable session identifiers.

+ Typical Severity

Medium

+ Typical Likelihood of Exploit

Likelihood: Medium

+ Methods of Attack
  • Injection
  • Time and State
+ Examples-Instances

Description

This example uses client side scripting to set session ID in the victim's browser. The JavaScript code

document.cookie="sessionid=0123456789"

fixates a falsified session credential into victim's browser, with the help of crafted a URL link.

http://www.example.com/<script>document.cookie="sessionid=0123456789";</script>

A similar example uses session ID as an argument of the URL.

http://www.example.com/index.php/sessionid=0123456789

Once the victim clicks the links, the attacker may be able to bypass authentication or piggy-back off some other authenticated victim's session.

+ Attacker Skills or Knowledge Required

Skill or Knowledge Level: Medium

Forge the session credential and reply the request.

+ Resources Required

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

+ Solutions and Mitigations

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.

+ Attack Motivation-Consequences
ScopeTechnical ImpactNote
Integrity
Modify files or directories
Confidentiality
Read files or directories
Integrity
Modify application data
Confidentiality
Read application data
Authorization
Execute unauthorized code or commands
Run Arbitrary Code
Accountability
Authentication
Authorization
Non-Repudiation
Gain privileges / assume identity
Access_Control
Authorization
Bypass protection mechanism
+ Injection Vector

GET or POST data, HTTP header, session cookies

+ Payload

Any HTTP Request transport variables (GET, POST, Headers, etc.)

+ Activation Zone

Target application's session management mechanism

+ Payload Activation Impact

The payload activation impact is that a session identifier of the attackers' choice is considered valid and trust decisions by the application will be based on such a forged identifier.

+ Purposes
  • Penetration
+ CIA Impact
Confidentiality Impact: HighIntegrity Impact: HighAvailability Impact: Low
+ Technical Context
Architectural Paradigms
Web
Client-Server
SOA
Frameworks
All
Platforms
All
Languages
All
+ References
[R.196.1] [REF-13] Thomas Schreiber. "Session Riding: A Widespread Vulnerability in Today's Web Applications". SecureNet GmbH. Dec 2004. <http://www.securenet.de/papers/Session_Riding.pdf>.
[R.196.2] [REF-3] "Common Weakness Enumeration (CWE)". CWE-384: Session Fixation. Draft. The MITRE Corporation. <http://cwe.mitre.org/data/definitions/384.html>.
[R.196.3] [REF-4] "OWASP Testing Guide". Testing for Session Management. v4 [DRAFT]. The Open Web Application Security Project (OWASP). <http://www.owasp.org/index.php/Testing_for_Session_Management>.
+ Content History
Submissions
SubmitterOrganizationDateSource
CAPEC Content TeamThe MITRE Corporation2014-06-23Internal_CAPEC_Team

More information is available — Please select a different filter.
Page Last Updated or Reviewed: December 07, 2015