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.

Severity (CVSS 3.1)5.9Medium
Exploit odds (30 days)0.3%top 73.6% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12node-mocha9.1.4+ds1+~cs28.2.8-1DEBIAN-CVE-2026-67213
Debian:13node-mocha9.1.4+ds1+~cs28.2.8-1DEBIAN-CVE-2026-67213
Debian:14node-mocha9.1.4+ds1+~cs28.2.8-1DEBIAN-CVE-2026-67213
Debian:12node-postcssno fix listedDEBIAN-CVE-2026-67213
Debian:13node-postcssno fix listedDEBIAN-CVE-2026-67213
Debian:14node-postcss8.5.8+~cs9.3.30-1DEBIAN-CVE-2026-67213
Ubuntu:22.04:LTSnode-postcssno fix listedUBUNTU-CVE-2026-67213
Ubuntu:24.04:LTSnode-postcssno fix listedUBUNTU-CVE-2026-67213
npmnanoid5.1.6GHSA-2v37-7h3g-55p8
npmnanoid3.3.18GHSA-2v37-7h3g-55p8

Affected products (as reported)

VendorProductVersions
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