You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/09/17 17:52:28 UTC

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

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:
users@infra.apache.org


With regards,
Apache Git Services