Skip to content

Deprecate RandomSessionIdGenerator due to insufficient entropy#2759

Open
wali-reheman wants to merge 1 commit into
apache:mainfrom
wali-reheman:fix/upstream-deprecate-random-session-id-generator
Open

Deprecate RandomSessionIdGenerator due to insufficient entropy#2759
wali-reheman wants to merge 1 commit into
apache:mainfrom
wali-reheman:fix/upstream-deprecate-random-session-id-generator

Conversation

@wali-reheman

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the java Pull requests that update Java code label Jun 6, 2026
@lprimak

lprimak commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Hi, Wali, thanks for your contribution.

We are not quite sure that the deprecation is the right way to go.
Please feel free to voice your opinion and discuss in the issue #2758

Also, can you please restore the PR template, the checklist is mandatory due to copyright issues.
Also, the @since should be 2.2.1 instead of 2.0
For now, let's put this PR on hold.

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
@lprimak lprimak force-pushed the fix/upstream-deprecate-random-session-id-generator branch from 3c02861 to 5406bcd Compare June 11, 2026 04:01

@lprimak lprimak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be annotated with forRemoval=true and since=2.2.1 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code pending-cla

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants