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.
Published: 2026-08-11
Score: 7.4 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

No advisories yet.

History

Thu, 13 Aug 2026 12:15:00 +0000

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


Thu, 13 Aug 2026 11:00:00 +0000

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

Wed, 12 Aug 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Tue, 11 Aug 2026 17:15:00 +0000

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'}


Subscriptions

Nanoid Project Nanoid
Redhat Hummingbird
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-12T14:29:36.568Z

Reserved: 2026-08-10T19:37:41.445Z

Link: CVE-2026-73086

cve-icon Vulnrichment

Updated: 2026-08-12T14:29:30.584Z

cve-icon NVD

Status : Received

Published: 2026-08-11T17:19:16.690

Modified: 2026-08-12T15:18:30.683

Link: CVE-2026-73086

cve-icon Redhat

Severity : Important

Publid Date: 2026-08-11T16:46:23Z

Links: CVE-2026-73086 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T14:15:05Z

Weaknesses
  • CWE-1241

    Use of Predictable Algorithm in Random Number Generator

  • CWE-190

    Integer Overflow or Wraparound