CVE-2026-67214: Loop with Unreachable Exit Condition ('Infinite Loop') in nanoid_project nanoid
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.
AI Analysis
Technical Summary
The nanoid library prior to version 5.1.16 has an infinite loop vulnerability in its non-secure module functions customAlphabet and nanoid. Specifically, if these functions are called with a negative size argument, the loop counter starts at a negative value and decrements without ever reaching the exit condition, resulting in an infinite loop. This behavior can cause the application to hang, leading to denial-of-service. The vulnerability requires that the size parameter be attacker-controlled and unvalidated to be exploitable.
Potential Impact
An attacker who can supply a negative size parameter to the affected functions can cause the application to enter an infinite loop, hanging the thread and resulting in a denial-of-service condition. There is no indication of code execution or data compromise from this vulnerability.
Mitigation Recommendations
A fix is available in nanoid version 5.1.16 and later. Users should upgrade to version 5.1.16 or newer to remediate this issue. Until upgraded, applications should validate input to ensure the size parameter passed to customAlphabet and nanoid functions is non-negative to prevent exploitation.
CVE-2026-67214: Loop with Unreachable Exit Condition ('Infinite Loop') in nanoid_project nanoid
Description
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.
CVSS v4.0
Score 8.2high
Affected software
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.16 has an infinite loop vulnerability in its non-secure module functions customAlphabet and nanoid. Specifically, if these functions are called with a negative size argument, the loop counter starts at a negative value and decrements without ever reaching the exit condition, resulting in an infinite loop. This behavior can cause the application to hang, leading to denial-of-service. The vulnerability requires that the size parameter be attacker-controlled and unvalidated to be exploitable.
Potential Impact
An attacker who can supply a negative size parameter to the affected functions can cause the application to enter an infinite loop, hanging the thread and resulting in a denial-of-service condition. There is no indication of code execution or data compromise from this vulnerability.
Mitigation Recommendations
A fix is available in nanoid version 5.1.16 and later. Users should upgrade to version 5.1.16 or newer to remediate this issue. Until upgraded, applications should validate input to ensure the size parameter passed to customAlphabet and nanoid functions is non-negative to prevent exploitation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-07-28T18:13:39.684Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a6a093c9c2644c7f89a3154
Added to database: 07/29/2026, 14:07:56 UTC
Last enriched: 07/29/2026, 14:23:08 UTC
Last updated: 07/29/2026, 14:52:48 UTC
Views: 4
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.