All vulnerabilities

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.

From the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
nanoidnpm · osv:npm:nanoid
  • Every version before 3.3.18
  • From 4.0.0 before 5.1.6

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