GHSA-28wg-ghj8-5hjv

    Dashboard / Vulnerabilities / GHSA-28wg-ghj8-5hjv

    GHSA-28wg-ghj8-5hjv

    Published: 29 Jul 2026Last Modified: 10 Aug 2026

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

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

    Affected packages

    Package

    Name: nanoid

    Purl: pkg:npm/nanoid

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0
    Fixed -3.3.16

    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