FJamil915108 (Community Member) asked a question.

What are compatible libraries for fixing CWE 331?

Veracode reports a flaw for the following code which uses RandomStringUtils.random from Apache Commons lang with SecureRandom:

private static final SecureRandom RANDOM = new SecureRandom();

 

public static String generateRandomAlphaNumeric(int length) {

return RandomStringUtils.random(length, 0, 0, true, true, null, RANDOM);

}

 

It seems that RandomStringUtils.random is automatically reported as having insufficient entropy by the Veracode scan. What other library alternatives work for fixing this flaw?


Topics (1)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.