Skip to content
Heist/ feed
High

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

Type: advisorySource: Official CVE List1 source record

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.

Announced Source revision 1
Original source ↗

CVE-2026-67213

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2026-67213

nanoid

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "vendor": "nanoid_project",
    "product": "nanoid",
    "versions": [
      {
        "status": "affected",
        "version": "3.0.0",
        "lessThan": "3.3.17",
        "versionType": "semver"
      },
      {
        "status": "affected",
        "version": "5.0.0",
        "lessThan": "5.1.6",
        "versionType": "semver"
      }
    ],
    "packageURL": "pkg:npm/nanoid",
    "defaultStatus": "affected"
  }
]
Related CVEs
CVE-2026-67213

Source reference: /cveMetadata/cveId

Publisher severity

high

Source reference: /containers/cna/metrics

Event
#12800 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement