Deprecate RandomSessionIdGenerator due to insufficient entropy#2759
Open
wali-reheman wants to merge 1 commit into
Open
Deprecate RandomSessionIdGenerator due to insufficient entropy#2759wali-reheman wants to merge 1 commit into
wali-reheman wants to merge 1 commit into
Conversation
Contributor
|
Hi, Wali, thanks for your contribution. We are not quite sure that the deprecation is the right way to go. Also, can you please restore the PR template, the checklist is mandatory due to copyright issues. |
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 apache#2758
3c02861 to
5406bcd
Compare
lprimak
requested changes
Jun 11, 2026
lprimak
left a comment
Contributor
There was a problem hiding this comment.
Please see the comments and these suggestions
Thank you!
| * implementation is a {@link java.security.SecureRandom SecureRandom} with the {@code SHA1PRNG} algorithm. | ||
| * | ||
| * @since 1.0 | ||
| * @deprecated since 2.0. Use {@link JavaUuidSessionIdGenerator} instead. This class uses only 64 bits of entropy |
Contributor
There was a problem hiding this comment.
Can you change this to @since 2.2.1 to make it accurate
| * which is below modern industry minimums (128 bits per OWASP ASVS and NIST SP 800-63B) and poses | ||
| * a security risk if used in production. | ||
| */ | ||
| @Deprecated |
Contributor
There was a problem hiding this comment.
This should be annotated with forRemoval=true and since=2.2.1 as well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Marks RandomSessionIdGenerator as @deprecated with a Javadoc pointing to JavaUuidSessionIdGenerator. The class only provides 64 bits of entropy via Long.toString(SecureRandom.nextLong()), below the 128-bit minimum required by OWASP ASVS and NIST SP 800-63B for session tokens.