Advisory

GHSA-28wg-ghj8-5hjv

Also known as: CVE-2026-67214

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2026-07-29 15:31 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

nanoid

npm · All systems

Affected

  • introduced 0, fixed 3.3.16 (semver)

Fixed versions

3.3.16

Fix

nanoid

npm · All systems

Affected

  • introduced 4.0.0, fixed 5.1.16 (semver)

Fixed versions

5.1.16

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences