[GitHub] [commons-lang] JLLeitschuh commented on issue #459: (doc): Document public RandomStringUtils exploit

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [commons-lang] JLLeitschuh commented on issue #459: (doc): Document public RandomStringUtils exploit

GitBox
JLLeitschuh commented on issue #459: (doc): Document public RandomStringUtils exploit
URL: https://github.com/apache/commons-lang/pull/459#issuecomment-532330032
 
 
   > Please note that the Apache Commons project provides a component dedicated to pseudo-random number generation, namely Commons RNG, that may be a better choice for applications with more stringent requirements (performance and/or correctness).
   
   When I read this, I don't think this refers to 'security' at all. 'Correctness' & 'Performance' do not equate to providing security benefit when I read it.
   
   If I had more time, I'd actually propose formally deprecating every single method on this class in favor of an API like this:
   
   ```java
   // Uses new Random()
   RandomStringUtils.insecureAndPredictable().random(32);
   
   // Uses new SecureRandom()
   RandomStringUtils.secure().random(32);
   
   RandomStringUtils.random(SecureRandom.getInstanceStrong()).random(32);
   ```
   
   That way it's made very clear to the developer that they are making an explicit choice for security here instead of defaulting to insecure randomness.
   
   I'm arguing this same exact point to the Kotlin team here:
   https://github.com/Kotlin/KEEP/issues/184

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services