Skip to main content

nanoid EUVDEUVD-2026-50325

| CVE-2026-67213 HIGH
Loop with Unreachable Exit Condition (Infinite Loop) (CWE-835)
2026-07-29 VulnCheck GHSA-2v37-7h3g-55p8
8.2
CVSS 4.0 · Vendor: VulnCheck
Share

Severity by source

Vendor (VulnCheck) PRIMARY
8.2 HIGH
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
7.5 HIGH

Availability-only DoS remotely triggerable with no auth or interaction, but only via an application code path passing attacker-controlled size 0, so impact is A:H with C:N/I:N.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE
5.9 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat
7.5 HIGH
qualitative

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

3
Source Code Evidence Fetched
Jul 29, 2026 - 14:23 vuln.today
Analysis Generated
Jul 29, 2026 - 14:23 vuln.today
CVE Published
Jul 29, 2026 - 13:32 cve.org
HIGH 8.2

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 227 npm packages depend on nanoid (84 direct, 146 indirect)

Ecosystem-wide dependent count for version 4.0.0.

DescriptionCVE.org

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.

AnalysisAI

Denial-of-service in nanoid (Nano ID) versions before 5.1.6 lets an attacker hang a Node.js/JavaScript thread by supplying a size value of 0 to the customAlphabet or customRandom generator functions, triggering an unbounded internal loop (CWE-835). Only applications that forward an unvalidated, attacker-controlled size parameter to these functions are exposed. A vendor patch exists (5.1.6) and the issue was reported by VulnCheck, but there is no public exploit identified at time of analysis and it is not listed in CISA KEV.

Technical ContextAI

nanoid is an extremely popular, tiny JavaScript unique-string-ID generator (single CPE cpe:2.3:a:nanoid_project:nanoid). The flaw is a CWE-835 'Loop with Unreachable Exit Condition' in the customAlphabet and customRandom factory functions: their generation routine repeatedly appends characters until the produced ID reaches the requested size, but a size of 0 makes the loop's exit condition unsatisfiable, so it spins forever and blocks the calling (typically single-threaded event-loop) thread. The default nanoid() and standard usage are not affected - only the custom-generator paths that accept a caller-provided size. The fix in commit cb3626d0 / release 5.1.6 adds handling so a 0 size no longer loops indefinitely.

RemediationAI

Vendor-released patch: upgrade to nanoid 5.1.6 or later, which fixes the infinite loop on a 0 size for customAlphabet (fix commit cb3626d0f3342fdf179cd425fd9c4fbb92c7d0e7; release https://github.com/ai/nanoid/releases/tag/5.1.6); run npm/yarn/pnpm update and rebuild lockfiles, and check transitive dependencies with npm ls nanoid since it is frequently pulled in indirectly. If you cannot upgrade immediately, the effective compensating control is input validation at the call site: reject or clamp any size value that is not a positive integer before passing it to customAlphabet/customRandom (e.g. enforce size >= 1), which fully neutralizes the trigger with no functional side effect for legitimate callers. Where the size is derived from user input such as a query parameter or request body, add server-side bounds checking and treat 0 as invalid; the only trade-off is that requests explicitly asking for a zero-length ID are rejected rather than served, which is the correct behavior anyway. Consult the VulnCheck advisory (https://www.vulncheck.com/advisories/nanoid-before-infinite-loop-via-zero-size-in-customalphabet-and-customrandom) for details.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 12 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected

Share

EUVD-2026-50325 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy