All vulnerabilities

npm

CVE-2024-55565

Predictable results in nanoid generation when given non-integer values

Severity
Medium 4.3
Published
9 Dec 2024
Last changed
10 Sept 2026
Added to UpHeron
10 Nov 2026
Fixed in
3.3.8, 5.0.9
Exploit chance
0.7% in the next 30 daysHigher than 52% of CVEs. EPSS by FIRST, 18 Nov 2026
Weakness
Infinite loop (CWE-835)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Change some data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
Also known as
GHSA-mwcw-c2x4-8c55
Sources
OSV.dev and GitHub

Description

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

  • in browser and non-secure, the code infinite loops on while (size--)
  • in node, the value of poolOffset becomes fractional, causing calls to nanoid to return zeroes until the pool is next filled
  • if the first call in node is a fractional argument, the initial buffer allocation fails with an error

Version 3.3.8 and 5.0.9 are fixed.

From the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
nanoidnpm · osv:npm:nanoid
  • Every version before 3.3.8
  • From 4.0.0 before 5.0.9

About nanoid

Weekly downloads (npm)
375,837,087npm, 15 Nov 2026

Vulnerabilities in nanoid

In our list
4
Published in the last 12 months
3
Critical, last 12 months
0
High, last 12 months
3
Known exploited
0
Search the list for nanoid

References