Search before asking
Enhancement Request
The org.apache.shiro.session.mgt.eis.RandomSessionIdGenerator class generates session IDs using Long.toString(SecureRandom.nextLong()), which provides only 64 bits of entropy. This falls below the modern industry minimum of 128 bits recommended by OWASP ASVS and NIST SP 800-63B for session tokens.
While Shiro's default JavaUuidSessionIdGenerator (UUID v4, 122-bit entropy) is secure and used out-of-the-box, the existence of RandomSessionIdGenerator in the public API poses a risk of misuse by developers who might explicitly configure it for legacy or perceived performance reasons.
Describe the solution you'd like
To improve the security posture and guide developers toward secure defaults, I propose the following hardening steps:
- Mark
RandomSessionIdGenerator as @Deprecated in the next minor release, with a Javadoc comment directing users to JavaUuidSessionIdGenerator.
- Add a startup WARN log if this class is explicitly instantiated or wired via
shiro.ini / Spring configuration.
- Remove the class entirely in the next major release (e.g., Shiro 3.x).
Are you willing to submit PR?
Search before asking
Enhancement Request
The
org.apache.shiro.session.mgt.eis.RandomSessionIdGeneratorclass generates session IDs usingLong.toString(SecureRandom.nextLong()), which provides only 64 bits of entropy. This falls below the modern industry minimum of 128 bits recommended by OWASP ASVS and NIST SP 800-63B for session tokens.While Shiro's default
JavaUuidSessionIdGenerator(UUID v4, 122-bit entropy) is secure and used out-of-the-box, the existence ofRandomSessionIdGeneratorin the public API poses a risk of misuse by developers who might explicitly configure it for legacy or perceived performance reasons.Describe the solution you'd like
To improve the security posture and guide developers toward secure defaults, I propose the following hardening steps:
RandomSessionIdGeneratoras@Deprecatedin the next minor release, with a Javadoc comment directing users toJavaUuidSessionIdGenerator.shiro.ini/ Spring configuration.Are you willing to submit PR?