npm
CVE-2026-67213
nanoid: custom generators can loop indefinitely when size is zero
- Severity
- High 5.9
- Published
- 29 Jul 2026
- Last changed
- 10 Sept 2026
- Added to UpHeron
- 22 Oct 2026
- Fixed in
- 3.3.18, 5.1.6
- 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-2v37-7h3g-55p8
- Sources
- OSV.dev and GitHub
Description
nanoid (Nano ID) before 5.1.6 contains an infinite loop in the customAlphabet and customRandom functions. When these functions are configured with a size of 0, the internal generation loop never satisfies its exit condition and spins indefinitely, hanging the calling thread. An application that passes an unvalidated, attacker-controlled size of 0 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-67214nanoid: non-secure generators can loop indefinitely with negative sizeHigh 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-67213
- GitHub Advisory Database https://github.com/advisories/GHSA-2v37-7h3g-55p8