All vulnerabilities

npm

CVE-2026-67214

nanoid: non-secure generators can loop indefinitely with negative size

Severity
High 5.9
Published
29 Jul 2026
Last changed
10 Sept 2026
Added to UpHeron
22 Oct 2026
Fixed in
3.3.16, 5.1.16
Exploit chance
0.3% in the next 30 daysHigher than 26% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Infinite loop (CWE-835)
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-28wg-ghj8-5hjv
Sources
OSV.dev and GitHub

Description

nanoid (Nano ID) before 5.1.16 contains an infinite loop in the customAlphabet and nanoid functions of its non-secure module (nanoid/non-secure). When these functions are given a negative size, the loop counter is decremented from a negative value and never reaches its termination condition, spinning indefinitely and hanging the calling thread. An application that passes an unvalidated, attacker-controlled negative size to these functions is exposed to a denial-of-service condition.

From the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
nanoidnpm · osv:npm:nanoid
  • Every version before 3.3.16
  • From 4.0.0 before 5.1.16

About nanoid

Weekly downloads (npm)
375,837,087npm, 15 Nov 2026

Vulnerabilities in nanoid

In our list
4
Published in the last 12 months
3
Critical, last 12 months
0
High, last 12 months
3
Known exploited
0
Search the list for nanoid

References