Insecure Randomness Affecting generate-pincode package, versions <5.0.2


0.0
high

Snyk CVSS

    Attack Complexity Low

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 npm:generate-pincode:20180612
  • published 12 Jun 2018
  • disclosed 11 Jun 2018
  • credit Niklas Volcz

Introduced: 11 Jun 2018

CVE NOT AVAILABLE CWE-330 Open this link 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