Vulnerability · Published Jul 29, 2026 · Assigned by VulnCheck
CVE-2026-67213nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom
Medium 5.9
In plain English
A medium-severity infinite loop in nanoid from nanoid_project. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 26% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-mocha | 9.1.4+ds1+~cs28.2.8-1 | DEBIAN-CVE-2026-67213 |
| Debian:13 | node-mocha | 9.1.4+ds1+~cs28.2.8-1 | DEBIAN-CVE-2026-67213 |
| Debian:14 | node-mocha | 9.1.4+ds1+~cs28.2.8-1 | DEBIAN-CVE-2026-67213 |
| Debian:12 | node-postcss | no fix listed | DEBIAN-CVE-2026-67213 |
| Debian:13 | node-postcss | no fix listed | DEBIAN-CVE-2026-67213 |
| Debian:14 | node-postcss | 8.5.8+~cs9.3.30-1 | DEBIAN-CVE-2026-67213 |
| Ubuntu:22.04:LTS | node-postcss | no fix listed | UBUNTU-CVE-2026-67213 |
| Ubuntu:24.04:LTS | node-postcss | no fix listed | UBUNTU-CVE-2026-67213 |
| npm | nanoid | 5.1.6 | GHSA-2v37-7h3g-55p8 |
| npm | nanoid | 3.3.18 | GHSA-2v37-7h3g-55p8 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| nanoid_project | nanoid | 3.0.0 – before 3.3.175.0.0 – before 5.1.6 |
Weakness: CWE-835 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- nanoid 5.1.6 release notes release-notes
- Fix commit (reject size of 0) patch
- VulnCheck Advisory: nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom third-party-advisory