GHSA-2v37-7h3g-55p8

    Dashboard / Vulnerabilities / GHSA-2v37-7h3g-55p8

    GHSA-2v37-7h3g-55p8

    Published: 29 Jul 2026Last Modified: 10 Sept 2026

    Summary: nanoid: custom generators can loop indefinitely when size is zero

    Details: 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 packages

    Package

    Name: nanoid

    Purl: pkg:npm/nanoid

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0
    Fixed -3.3.18

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GHSA-2v37-7h3g-55p8 | CVE-DB