Integer Overflow or Wraparound Affecting nanoid package, versions <3.3.12>=4.0.0 <5.1.11


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.3% (23rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-NANOID-18748186
  • published13 Aug 2026
  • disclosed12 Aug 2026
  • creditalanzabihi

Introduced: 12 Aug 2026

NewCVE-2026-73086  (opens in a new tab)
CWE-190  (opens in a new tab)

How to fix?

Upgrade nanoid to version 3.3.12, 5.1.11 or higher.

Overview

Affected versions of this package are vulnerable to Integer Overflow or Wraparound through the fillPool logic in index.js and index.cjs. An attacker can make subsequent ID generation deterministic by supplying an oversized size value to nanoid(size), which is coerced into a negative 32-bit integer and corrupts the shared random pool state. After that call, all later IDs produced in the same process lose their randomness and uniqueness, breaking session tokens, CSRF tokens, and other identifiers until the process restarts.

CVSS Base Scores

version 4.0
version 3.1