CVE-2026-73086

nanoid: Integer Overflow or Wraparound

Published Aug 11, 2026 CVSS 3.1 · 7.4 High EPSS < 1% KEV · Not listed
Description
nanoid is a secure, URL-friendly, unique string ID generator for JavaScript. Prior to versions 3.3.12 and 5.1.11, the nanoid(size) function in index.js and index.cjs coerces the user-influenced size parameter to a signed 32-bit integer, allowing a value of 2147483648 to become -2147483648 and corrupt the process-wide CSPRNG poolOffset in fillPool(), which causes subsequent session tokens, CSRF tokens, API keys, and unique identifiers to become the deterministic string "uuuuuuuuuuuuuuuuuuuuu" until the process restarts. This issue is fixed in versions 3.3.12 and 5.1.11.

Analysis

AI-generated

Technical impact

An integer overflow in the nanoid(size) function allows a crafted size value of 2147483648 to be interpreted as -2147483648, corrupting the library’s CSPRNG poolOffset. This overflow causes all subsequent tokens—including session identifiers, CSRF tokens, and API keys—to be the deterministic string “uuuuuuuuuuuuuuuuuuuuu”. An attacker who can supply the overflowed size can therefore predict future authentication tokens, enabling session hijacking, CSRF exploitation, and compromise of any system that relies on nanoid for unique identifiers.

Affected Systems

All JavaScript projects that depend on the nanoid library with a version older than 3.3.12 or 5.1.11 are vulnerable. This includes many Node.js, Express, and front‑end applications that generate session or CSRF tokens, API keys, or unique identifiers via nanoid. The vulnerability affects both the ES module and CommonJS builds. Upgrading to 3.3.12 or later removes the signed‑integer coercion and restores proper random token generation.

Risk and Exploitability

The CVSS score of 7.4 indicates a high impact, but the EPSS score of less than 1 % suggests a low probability of exploitation at present, and the issue is not listed in the CISA KEV catalog. The likely attack vector is a form or API that permits the attacker to control or influence the size argument passed to nanoid, possibly through input validation bypass or direct payload injection. Once the overflow is triggered, the deterministic token pattern removes randomness, immediately exposing the application to session fixation, replay, or CSRF attacks.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade nanoid to version 3.3.12 or newer (5.1.11 for non‑ESM projects).
  • Validate or sanitize any user‑provided size values to ensure they fall within a safe integer range before passing them to nanoid.
  • If an upgrade is not immediately feasible, temporarily replace nanoid with an alternative UUID or random ID generator and monitor token logs for unexpected repetition of the string “uuuuuuuuuuuuuuuuuuuuu” to detect exploitation.
  • Add explicit checks for integer bounds to guard against overflow and wraparound (CWE‑190, CWE‑1241) in any custom wrappers or extensions that invoke nanoid.

Generated by OpenCVE AI on August 13, 2026 at 14:03 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-xwg4-73v4-xw9w nanoid: Integer Overflow or Wraparound
History
Type Values Removed Values Added
First Time appeared Redhat
Redhat hummingbird
Weaknesses CWE-1241
CPEs cpe:/a:redhat:hummingbird:1
Vendors & Products Redhat
Redhat hummingbird
References
Metrics threat_severity

None

threat_severity

Important

Type Values Removed Values Added
First Time appeared Nanoid Project
Nanoid Project nanoid
Vendors & Products Nanoid Project
Nanoid Project nanoid
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description nanoid is a secure, URL-friendly, unique string ID generator for JavaScript. Prior to versions 3.3.12 and 5.1.11, the nanoid(size) function in index.js and index.cjs coerces the user-influenced size parameter to a signed 32-bit integer, allowing a value of 2147483648 to become -2147483648 and corrupt the process-wide CSPRNG poolOffset in fillPool(), which causes subsequent session tokens, CSRF tokens, API keys, and unique identifiers to become the deterministic string "uuuuuuuuuuuuuuuuuuuuu" until the process restarts. This issue is fixed in versions 3.3.12 and 5.1.11.
Title nanoid: Integer Overflow or Wraparound
Weaknesses CWE-190
References
Metrics cvssV3_1

{'score': 7.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N'}

Weaknesses
  • CWE-1241

    Use of Predictable Algorithm in Random Number Generator

  • CWE-190

    Integer Overflow or Wraparound

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 12, 2026, 2:29 PM
Reserved
Aug 10, 2026, 7:37 PM
Status
Deferred
Published
Aug 11, 2026, 5:19 PM
Modified
Oct 24, 2026, 3:10 PM
Severity
Important
Public date
Aug 11, 2026, 4:46 PM