Description
The J2EE application is configured to use an insufficient session ID length.
If an attacker can guess or steal a session ID, then they may be able to take over the user's session (called session hijacking). The number of possible session IDs increases with increased session ID length, making it more difficult to guess or steal a session ID.
Potential Impact
Access Control
Gain Privileges or Assume Identity
Demonstrative Examples
<sun-web-app>
...<session-config>
<session-properties><property name="idLengthBytes" value="8"><description>The number of bytes in this web module's session ID.</description></property></session-properties>
</session-config>...
</sun-web-app>Mitigations & Prevention
Session identifiers should be at least 128 bits long to prevent brute-force session guessing. A shorter session identifier leaves the application open to brute-force session guessing attacks.
A lower bound on the number of valid session identifiers that are available to be guessed is the number of users that are active on a site at any given moment. However, any users that abandon their sessions without logging out will increase this number. (This is one of many good reasons to have a short inactive session timeout.) With a 64 bit session identifier, assume 32 bits of entropy. For a large web site, assume that the attacker can try 1,000 guesses per second and that there are 10,000 va
Related Weaknesses
Taxonomy Mappings
- 7 Pernicious Kingdoms: — J2EE Misconfiguration: Insufficient Session-ID Length
Frequently Asked Questions
What is CWE-6?
CWE-6 (J2EE Misconfiguration: Insufficient Session-ID Length) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Variant-level weakness. The J2EE application is configured to use an insufficient session ID length.
How can CWE-6 be exploited?
Attackers can exploit CWE-6 (J2EE Misconfiguration: Insufficient Session-ID Length) to gain privileges or assume identity. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.
How do I prevent CWE-6?
Key mitigations include: Session identifiers should be at least 128 bits long to prevent brute-force session guessing. A shorter session identifier leaves the application open to brute-force session guessing attacks.
What is the severity of CWE-6?
CWE-6 is classified as a Variant-level weakness (Low-Medium abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.