Nanoid_project nanoid
nanoid Infinite Loop via Negative Size in non-secure module
nanoid (Nano ID) before 3.3.16 and 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.
First public PoC
None yetno public PoC found
Public PoCs00 on GitHub
CVSS8.2high · scored by CNA · CWE-835
CISA KEV
Not listednot known exploited
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
nanoid_project nanoid
- >= 4.0.0, < 5.1.16
- < 3.3.16
Fixed in 5.1.16, 3.3.16
Mitigation
Upgrade nanoid to 5.1.16 or 3.3.16 or later.
References
- Release notes github.com/ai/nanoid/releases/tag/5.1.16
- Release notes github.com/ai/nanoid/releases/tag/3.3.16
- Patch github.com/ai/nanoid/commit/6ccc67bbaba71d3d77…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.