CVE-2026-67213
JSON

8.2high

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

Severity
8.2high CVSS:4.0 by VulnCheck
Exploit likelihood
0.33% (higher than 28% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-2v37-7h3g-55p8

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

Product or packageVersionsReported by
nanoid_project nanoidfrom 3.0.0 before 3.3.17, from 5.0.0 before 5.1.6CVE List, NVD
nanoid (npm)before 3.3.18, from 4.0.0 before 5.1.6GitHub Advisory Database

All scores

VulnCheck8.2high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
VulnCheck5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub5.9high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-835

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

nanoid (Nano ID) antes de 5.1.6 contiene un bucle infinito en las funciones customAlphabet y customRandom. Cuando estas funciones se configuran con un tamaño de 0, el bucle de generación interno nunca satisface su condición de salida y gira indefinidamente, colgando el hilo de llamada. Una aplicación que pasa un tamaño de 0 no validado y controlado por el atacante a estas funciones está expuesta a una condición de denegación de servicio.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-67213 changed 2026-10-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-2v37-7h3g-55p8 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-67213 changed 2026-10-23Public domain