CWE-6 · Słabość
J2EE Misconfiguration: Insufficient Session-ID Length
- Abstrakcja
- Wariant
- Status
- Niekompletny
- Dodano
- 19 lipca 2006
- Ostatnia zmiana
- 11 grudnia 2025
Opis
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.
Skutki
Access Control
Gain Privileges or Assume Identity
If an attacker can guess an authenticated user's session identifier, they can take over the user's session.
Zapobieganie
Implementation
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.
Implementation
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 valid session identifiers at any given moment. Given these assumptions, the expected time for an attacker to successfully guess a valid session identifier is less than 4 minutes. Now assume a 128 bit session identifier that provides 64 bits of entropy. With a very large web site, an attacker might try 10,000 guesses per second with 100,000 valid session identifiers available to be guessed. Given these assumptions, the expected time for an attacker to successfully guess a valid session identifier is greater than 292 years.
Słabość nadrzędna
Kiedy powstaje
- Architecture and Design — COMMISSION: This weakness refers to an incorrect design related to an architectural security tactic.
- Implementation
Dotyczy
Java, Web Based, Web Server
Źródła
- Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors — Katrina Tsipenyuk, Brian Chess, Gary McGraw, NIST, 2005
- Hold Your Sessions: An Attack on Java Session-id Generation — Zvi Gutterman, 2005
Wpis z katalogu CWE 4.20.