Intel

AIKIDO-2026-792646

nanoid is vulnerable to Denial of Service (DoS)

CVE-2026-67213Published Jul 30, 2026
July 30, 2026

59

CVE Score

Medium

Denial of Service (DoS)

Are you affected? Scan for Free

TL;DR

The customAlphabet and customRandom generators in nanoid build an identifier inside a loop that only exits once the requested count of characters is produced. When these functions receive a size of 0, the loop never satisfies its exit condition and spins indefinitely, hanging the calling thread. An application that forwards an unvalidated, externally influenced size of 0 into these functions is exposed to a denial-of-service condition. The fix returns an empty string for a zero size so the loop terminates.

How do I fix this?

Upgrade the org.webjars.npm:nanoid library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application passes an unvalidated, externally influenced size of 0 to the customAlphabet or customRandom functions.

Package

Versions

0.0.1 - 5.1.5

Fixed in 5.1.6

Background info

nanoid is vulnerable to Denial of Service (DoS) in versions 0.0.1 - 5.1.5.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea