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.
Advisories
Source ID Title
Github GHSA Github GHSA GHSA-2v37-7h3g-55p8 nanoid: custom generators can loop indefinitely when size is zero
Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Tue, 11 Aug 2026 00:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Important


Wed, 29 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 29 Jul 2026 14:00:00 +0000

Type Values Removed Values Added
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.
Title nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom
First Time appeared Nanoid Project
Nanoid Project nanoid
Weaknesses CWE-835
CPEs cpe:2.3:a:nanoid_project:nanoid:*:*:*:*:*:node.js:*:*
Vendors & Products Nanoid Project
Nanoid Project nanoid
References
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'}

cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}


Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-10T15:46:10.778Z

Reserved: 2026-07-28T18:13:39.684Z

Link: CVE-2026-67213

cve-icon Vulnrichment

Updated: 2026-07-29T14:41:57.726Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-07-29T14:16:34.890

Modified: 2026-08-10T16:19:48.757

Link: CVE-2026-67213

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-29T13:32:01Z

Links: CVE-2026-67213 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T12:30:09Z

Weaknesses