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.
Affected software
| Software | Affected versions |
|---|---|
nanoidnpm · osv:npm:nanoid |
|
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
- CVE-2026-73086nanoid: Integer Overflow or WraparoundHigh 7.4 1 Sept 2026
- CVE-2026-67214nanoid: non-secure generators can loop indefinitely with negative sizeHigh 5.9 29 Jul 2026
- CVE-2026-67213nanoid: custom generators can loop indefinitely when size is zeroHigh 5.9 29 Jul 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2024-55565
- GitHub Advisory Database https://github.com/advisories/GHSA-mwcw-c2x4-8c55