Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
Examples of errors detected by the...

Examples of errors detected by the V5307 diagnostic

V5307. OWASP. Potentially predictable seed is used in pseudo-random number generator.


DBeaver

V5307. Potentially predictable seed is used in pseudo-random number generator. DataSourceDescriptor.java 1847


public static String generateNewId(DBPDriver driver) {
  long rnd = new Random().nextLong();               // <=
  if (rnd < 0) rnd = -rnd;
  return driver.getId() + "-"
                        + Long.toHexString(System.currentTimeMillis())
                        + "-"
                        + Long.toHexString(rnd);
}