Vulnerabilities/

Predictable results in nanoid generation when given non-integer values

Severity:
Medium

Description

When nanoid is called with a fractional value, there were a number of undesirable effects:

  1. in browser and non-secure, the code infinite loops on while (size–)
  2. in node, the value of poolOffset becomes fractional, causing calls to nanoid to return zeroes until the pool is next filled 3.

Recommendation

Update the nanoid package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
nanoid
Anything's wrong? Let us know Last updated on December 13, 2024

This issue is available in SmartScanner Professional

See Pricing