Insecure Randomness Affecting generate-pincode package, versions <5.0.2


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

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 Learn

Learn about Insecure Randomness vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDnpm:generate-pincode:20180612
  • published12 Jun 2018
  • disclosed11 Jun 2018
  • creditNiklas Volcz

Introduced: 11 Jun 2018

CVE NOT AVAILABLE CWE-330  (opens in a new tab)

How to fix?

Upgrade generate-pincode to version 5.0.2 or higher.

Overview

generate-pincode is a module for generating random pincodes.

Affected versions of the package are vulnerable to Insecure Randomness. It used the cryptographically insecure Math.random() in order to shuffle the pin code array, which can produce predictable values and should not be used in security-sensitive context.

Typically, Math.random() is sufficient for most uses but should be avoided for cryptographic use, where the ability to predict the outcome gives the attacker a significant advantage.

References

CVSS Scores

version 3.1