Skip to content

Commit 5406bcd

Browse files
wali-rehemanlprimak
authored andcommitted
Deprecate RandomSessionIdGenerator due to insufficient entropy (64-bit)
Marks the class @deprecated with a Javadoc pointing to JavaUuidSessionIdGenerator. Modern industry standards (OWASP ASVS, NIST SP 800-63B) require a minimum of 128 bits of entropy for session tokens. RandomSessionIdGenerator only provides 64 bits via Long.toString(SecureRandom.nextLong()). Fixes #2758
1 parent 4997ed3 commit 5406bcd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

core/src/main/java/org/apache/shiro/session/mgt/eis/RandomSessionIdGenerator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
* implementation is a {@link java.security.SecureRandom SecureRandom} with the {@code SHA1PRNG} algorithm.
3131
*
3232
* @since 1.0
33+
* @deprecated since 2.0. Use {@link JavaUuidSessionIdGenerator} instead. This class uses only 64 bits of entropy
34+
* which is below modern industry minimums (128 bits per OWASP ASVS and NIST SP 800-63B) and poses
35+
* a security risk if used in production.
3336
*/
37+
@Deprecated
3438
public class RandomSessionIdGenerator implements SessionIdGenerator {
3539

3640
private static final Logger LOGGER = LoggerFactory.getLogger(RandomSessionIdGenerator.class);

0 commit comments

Comments
 (0)