Such a scenario is commonly observed when:
In the generic exploit of session fixation vulnerabilities, an attacker creates a new session on a web application and records the associated session identifier. The attacker then causes the victim to associate, and possibly authenticate, against the server using that session identifier, giving the attacker access to the user's account through the active session.
Impact | Details |
---|---|
Gain Privileges or Assume Identity |
Scope: Access Control |
Phase(s) | Mitigation |
---|---|
Architecture and Design |
Invalidate any existing session identifiers prior to authorizing a new user session.
|
Architecture and Design |
For platforms such as ASP that do not generate new values for sessionid cookies, utilize a secondary cookie. In this approach, set a secondary cookie on the user's browser to a random value and set a session variable to the same value. If the session variable and the cookie value ever don't match, invalidate the session, and force the user to log on again.
|
Operation |
Strategy: Firewall Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
Effectiveness: Moderate Note:
An application firewall might not cover all possible input vectors. In addition, attack techniques might be available to bypass the protection mechanism, such as using malformed inputs that can still be processed by the component that receives those inputs. Depending on functionality, an application firewall might inadvertently reject or modify legitimate requests. Finally, some manual effort may be required for customization.
|
Nature | Type | ID | Name |
---|---|---|---|
Requires | ClassClass - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 346 | Origin Validation Error |
Requires | ClassClass - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 441 | Unintended Proxy or Intermediary ('Confused Deputy') |
Requires | BaseBase - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 472 | External Control of Assumed-Immutable Web Parameter |
Nature | Type | ID | Name |
---|---|---|---|
ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 610 | Externally Controlled Reference to a Resource in Another Sphere |
CanFollow | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 340 | Generation of Predictable Numbers or Identifiers |
Nature | Type | ID | Name |
---|---|---|---|
ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 610 | Externally Controlled Reference to a Resource in Another Sphere |
Nature | Type | ID | Name |
---|---|---|---|
MemberOf | Category Category - a CWE entry that contains a set of other entries that share a common characteristic. | 1018 | Manage User Sessions |
Phase | Note |
---|---|
Architecture and Design | |
Implementation |
Class: Not Language-Specific (Undetermined Prevalence)
Example 1
The following example shows a snippet of code from a J2EE web application where the application authenticates users with LoginContext.login() without first calling HttpSession.invalidate().
In order to exploit the code above, an attacker could first create a session (perhaps by logging into the application) from a public terminal, record the session identifier assigned by the application, and reset the browser to the login page. Next, a victim sits down at the same public terminal, notices the browser open to the login page of the site, and enters credentials to authenticate against the application. The code responsible for authenticating the victim continues to use the pre-existing session identifier, now the attacker simply uses the session identifier recorded earlier to access the victim's active session, providing nearly unrestricted access to the victim's account for the lifetime of the session. Even given a vulnerable application, the success of the specific attack described here is dependent on several factors working in the favor of the attacker: access to an unmonitored public terminal, the ability to keep the compromised session active and a victim interested in logging into the vulnerable application on the public terminal.
In most circumstances, the first two challenges are surmountable given a sufficient investment of time. Finding a victim who is both using a public terminal and interested in logging into the vulnerable application is possible as well, so long as the site is reasonably popular. The less well known the site is, the lower the odds of an interested victim using the public terminal and the lower the chance of success for the attack vector described above. The biggest challenge an attacker faces in exploiting session fixation vulnerabilities is inducing victims to authenticate against the vulnerable application using a session identifier known to the attacker.
In the example above, the attacker did this through a direct method that is not subtle and does not scale suitably for attacks involving less well-known web sites. However, do not be lulled into complacency; attackers have many tools in their belts that help bypass the limitations of this attack vector. The most common technique employed by attackers involves taking advantage of cross-site scripting or HTTP response splitting vulnerabilities in the target site [12]. By tricking the victim into submitting a malicious request to a vulnerable application that reflects JavaScript or other code back to the victim's browser, an attacker can create a cookie that will cause the victim to reuse a session identifier controlled by the attacker. It is worth noting that cookies are often tied to the top level domain associated with a given URL. If multiple applications reside on the same top level domain, such as bank.example.com and recipes.example.com, a vulnerability in one application can allow an attacker to set a cookie with a fixed session identifier that will be used in all interactions with any application on the domain example.com [29].
Example 2
The following example shows a snippet of code from a J2EE web application where the application authenticates users with a direct post to the <code>j_security_check</code>, which typically does not invalidate the existing session before processing the login request.
Note: this is a curated list of examples for users to understand the variety of ways in which this weakness can be introduced. It is not a complete list of all CVEs that are related to this CWE entry.
Reference | Description |
---|---|
Website software for game servers does not proprerly terminate user sessions, allowing for possible session fixation
|
Nature | Type | ID | Name |
---|---|---|---|
MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 361 | 7PK - Time and State |
MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 724 | OWASP Top Ten 2004 Category A3 - Broken Authentication and Session Management |
MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 930 | OWASP Top Ten 2013 Category A2 - Broken Authentication and Session Management |
MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1028 | OWASP Top Ten 2017 Category A2 - Broken Authentication |
MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1353 | OWASP Top Ten 2021 Category A07:2021 - Identification and Authentication Failures |
MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1364 | ICS Communications: Zone Boundary Failures |
MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1366 | ICS Communications: Frail Security in Protocols |
MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1396 | Comprehensive Categorization: Access Control |
Rationale
This is a well-known Composite of multiple weaknesses that must all occur simultaneously, although it is attack-oriented in nature.Comments
While attack-oriented composites are supported in CWE, they have not been a focus of research. There is a chance that future research or CWE scope clarifications will change or deprecate them. Perform root-cause analysis to determine which weaknesses allow session fixation to occur, and map to those weaknesses. For example, predictable session identifiers might enable session fixation attacks to succeed; if this occurs, they might be better characterized as randomness/predictability weaknesses.Other
Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
---|---|---|---|
7 Pernicious Kingdoms | Session Fixation | ||
OWASP Top Ten 2004 | A3 | CWE More Specific | Broken Authentication and Session Management |
WASC | 37 | Session Fixation |
CAPEC-ID | Attack Pattern Name |
---|---|
CAPEC-196 | Session Credential Falsification through Forging |
CAPEC-21 | Exploitation of Trusted Identifiers |
CAPEC-31 | Accessing/Intercepting/Modifying HTTP Cookies |
CAPEC-39 | Manipulating Opaque Client-based Data Tokens |
CAPEC-59 | Session Credential Falsification through Prediction |
CAPEC-60 | Reusing Session IDs (aka Session Replay) |
CAPEC-61 | Session Fixation |
Submissions | ||
---|---|---|
Submission Date | Submitter | Organization |
2006年07月19日
(CWE Draft 3, 2006年07月19日) |
7 Pernicious Kingdoms | |
Modifications | ||
Modification Date | Modifier | Organization |
2025年09月09日
(CWE 4.18, 2025年09月09日) |
CWE Content Team | MITRE |
updated Potential_Mitigations, References | ||
2024年07月16日
(CWE 4.15, 2024年07月16日) |
CWE Content Team | MITRE |
updated Relationships | ||
2023年10月26日 | CWE Content Team | MITRE |
updated Observed_Examples | ||
2023年06月29日 | CWE Content Team | MITRE |
updated Mapping_Notes, Relationships | ||
2023年04月27日 | CWE Content Team | MITRE |
updated Relationships | ||
2021年10月28日 | CWE Content Team | MITRE |
updated Relationships | ||
2020年06月25日 | CWE Content Team | MITRE |
updated Description | ||
2020年02月24日 | CWE Content Team | MITRE |
updated References, Relationships | ||
2019年06月20日 | CWE Content Team | MITRE |
updated Relationships | ||
2018年03月27日 | CWE Content Team | MITRE |
updated Relationships | ||
2017年11月08日 | CWE Content Team | MITRE |
updated Applicable_Platforms, Modes_of_Introduction, Relationships | ||
2015年12月07日 | CWE Content Team | MITRE |
updated Relationships | ||
2013年07月17日 | CWE Content Team | MITRE |
updated Relationships | ||
2012年10月30日 | CWE Content Team | MITRE |
updated Potential_Mitigations | ||
2011年06月01日 | CWE Content Team | MITRE |
updated Common_Consequences | ||
2010年02月16日 | CWE Content Team | MITRE |
updated Taxonomy_Mappings | ||
2009年07月27日 | CWE Content Team | MITRE |
updated Demonstrative_Examples, Related_Attack_Patterns | ||
2008年09月08日 | CWE Content Team | MITRE |
updated Description, Relationships, Other_Notes, Taxonomy_Mappings | ||
2008年08月15日 | Veracode | |
Suggested OWASP Top Ten 2004 mapping | ||
2008年07月01日 | Eric Dalci | Cigital |
updated Time_of_Introduction |
Use of the Common Weakness Enumeration (CWE™) and the associated references from this website are subject to the Terms of Use. CWE is sponsored by the U.S. Department of Homeland Security (DHS) Cybersecurity and Infrastructure Security Agency (CISA) and managed by the Homeland Security Systems Engineering and Development Institute (HSSEDI) which is operated by The MITRE Corporation (MITRE). Copyright © 2006–2025, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation.