CVE-2026-67213

nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom

State
Published
Severity
8.2 High
Published
Jul 29, 2026
Updated
Oct 8, 2026
Reserved
Jul 28, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.08.2 HighCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NVulnCheck
3.15.9 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:HVulnCheck

Weaknesses

  • CWE-835 Loop with Unreachable Exit Condition ('Infinite Loop')

Affected Products

ProductVersions
nanoidnanoid_project
  • 3.0.0 to before 3.3.17Affected
  • 5.0.0 to before 5.1.6Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.