CVE-2026-67213 nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom
An attacker can cause a denial of service by passing a size of zero to nanoid's custom generation functions, hanging the application thread.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-67213?
CVE-2026-67213 is a high-severity denial of service vulnerability in nanoid_project nanoid, published on 29 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-835
Which versions are affected by CVE-2026-67213?
4 open source packages ship an affected version, including nanoid. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
nanoid npm | All versions | 3.3.18 |
nanoid npm | All versions | 3.3.18 |
nanoid npm | From 4.0.0 | 5.1.6 |
nanoid npm | From 4.0.0 | 5.1.6 |
Linux distribution packages (1)
jaeger Red Hat:hummingbird:1 | All versions | 0:2.20.0-0.6.hum1 |
Products include Nanoid Project Nanoid.
How do I fix CVE-2026-67213?
Upgrade nanoid to a fixed version for your release line: 3.3.18 or 5.1.6.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2026-67213 being exploited?
There is no known exploitation of CVE-2026-67213 in the wild and no public exploit code.
Other vulnerabilities in nanoid_project nanoid
Sources
Also known as CLEANSTART-2026-EK72543, CLEANSTART-2026-EO53027, CLEANSTART-2026-SY32977, CLSA-2026-1791200139, CLSA-2026-1791208139, CLSA-2026-1791208360 and 27 more.