generate-pincode@2.0.3 vulnerabilities

Generate random pincode

Direct Vulnerabilities

Known vulnerabilities in the generate-pincode package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • H
Insecure Randomness

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.

How to fix Insecure Randomness?

Upgrade generate-pincode to version 5.0.2 or higher.

<5.0.2