CVE-2026-67213: Loop with Unreachable Exit Condition ('Infinite Loop') in nanoid_project nanoid
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.
AI Analysis
Technical Summary
The nanoid library prior to version 5.1.6 contains an infinite loop vulnerability in its customAlphabet and customRandom functions. When these functions receive a size argument of 0, the internal loop that generates the ID never meets its exit condition, causing the function to spin indefinitely. This can hang the calling thread and cause a denial-of-service if the size parameter is attacker-controlled and not validated.
Potential Impact
An attacker who can supply an unvalidated size parameter of 0 to the affected nanoid functions can cause the application to hang indefinitely, resulting in a denial-of-service condition. This impacts availability but does not affect confidentiality or integrity.
Mitigation Recommendations
Patch to nanoid version 5.1.6 or later where this infinite loop issue is fixed. Until patched, ensure that the size parameter passed to customAlphabet and customRandom functions is validated to never be 0 to prevent triggering the infinite loop.
CVE-2026-67213: Loop with Unreachable Exit Condition ('Infinite Loop') in nanoid_project nanoid
Description
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.
CVSS v4.0
Score 8.2high
Affected software
nanoid_project
nanoid
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The nanoid library prior to version 5.1.6 contains an infinite loop vulnerability in its customAlphabet and customRandom functions. When these functions receive a size argument of 0, the internal loop that generates the ID never meets its exit condition, causing the function to spin indefinitely. This can hang the calling thread and cause a denial-of-service if the size parameter is attacker-controlled and not validated.
Potential Impact
An attacker who can supply an unvalidated size parameter of 0 to the affected nanoid functions can cause the application to hang indefinitely, resulting in a denial-of-service condition. This impacts availability but does not affect confidentiality or integrity.
Mitigation Recommendations
Patch to nanoid version 5.1.6 or later where this infinite loop issue is fixed. Until patched, ensure that the size parameter passed to customAlphabet and customRandom functions is validated to never be 0 to prevent triggering the infinite loop.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-07-28T18:13:39.684Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a6a093c9c2644c7f89a314f
Added to database: 07/29/2026, 14:07:56 UTC
Last enriched: 08/13/2026, 16:17:14 UTC
Last updated: 09/12/2026, 22:01:36 UTC
Views: 120
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.