npm
CVE-2026-67214
nanoid: non-secure generators can loop indefinitely with negative size
- Severity
- High 5.9
- Published
- 29 Jul 2026
- Last changed
- 10 Sept 2026
- Added to UpHeron
- 22 Oct 2026
- Fixed in
- 3.3.16, 5.1.16
- Exploit chance
- 0.3% in the next 30 daysHigher than 26% of CVEs. EPSS by FIRST, 19 Nov 2026
- Weakness
- Infinite loop (CWE-835)
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Take it down
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H- Also known as
- GHSA-28wg-ghj8-5hjv
- Sources
- OSV.dev and GitHub
Description
nanoid (Nano ID) before 5.1.16 contains an infinite loop in the customAlphabet and nanoid functions of its non-secure module (nanoid/non-secure). When these functions are given a negative size, the loop counter is decremented from a negative value and never reaches its termination condition, spinning indefinitely and hanging the calling thread. An application that passes an unvalidated, attacker-controlled negative size to these functions is exposed to a denial-of-service condition.
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-67213nanoid: custom generators can loop indefinitely when size is zeroHigh 5.9 29 Jul 2026
- CVE-2024-55565Predictable results in nanoid generation when given non-integer valuesMedium 4.3 9 Dec 2024
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-67214
- GitHub Advisory Database https://github.com/advisories/GHSA-28wg-ghj8-5hjv