Insecure Randomness Affecting Open this link in a new tab package, versions <1.1.1

  • Attack Complexity


Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • snyk-id


  • published

    23 May 2021

  • disclosed

    21 May 2021

  • credit


Introduced: 21 May 2021

CWE-330 Open this link in a new tab

How to fix?

Upgrade to version 1.1.1 or higher.

Overview is a provides users with utility functions to manipulate strings in various ways.

Affected versions of this package are vulnerable to Insecure Randomness via the RandomAlphaNumeric(int) and CryptoRandomAlphaNumeric(int) functions. Small values of int in the functions above will return a smaller subset of results than they should. For example, RandomAlphaNumeric(1) would always return a digit in the 0-9 range, while RandomAlphaNumeric(4) return around ~7 million of the ~13M possible permutations.