Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upJava: PRNG used when CSPRNG is required #30
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


PRNG -> Pseudorandom Number Generator (predictably random)
CSPRNG -> Cryptographically Secure Pseudorandom Number Generator
CVE ID(s)
Most of these were not found using CodeQL. Most of them were found using GitHub's fuzzy code search.
I've got at least one CVE in flight for this currently.
Report
The goal of this query is to detect the use of a PRNG like
java.util.Random, org.apache.commons.lang.RandomStringUtils,org.apache.commons.text.RandomStringGenerator, orjava.util.concurrent.ThreadLocalRandomin a security sensitive context.Security sensitive would be things like password reset URLs, token cookies, & temporary reset passwords.
This vulnerability can have up to a CVSSv3 score of 9.8/10 depending upon the use of the insecure data generated.
Query
The query can be found here: github/codeql#2694
Talk about the Query?
Sure, why not.