CVE-2026-73086
Received Received - Intake

Integer Overflow in NanoID Leading to Predictable Tokens

Vulnerability report for CVE-2026-73086, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-11

Last updated on: 2026-08-11

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-11
Last Modified
2026-08-11
Generated
2026-08-11
AI Q&A
2026-08-11
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 6 associated CPEs
Vendor Product Version / Range
nanoid nanoid to 3.3.12 (exc)
nanoid nanoid to 5.1.11 (exc)
ai nanoid to 3.3.12 (inc)
ai nanoid to 5.1.11 (inc)
ai nanoid to 5.1.11 (exc)
ai nanoid to 3.3.12 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-190 The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is an integer overflow issue in the nanoid library affecting versions up to 5.1.10. When a user-controlled size parameter of 2^31 or larger is passed to the nanoid() function, it causes an integer overflow that corrupts the process-wide CSPRNG pool. This leads to all subsequent ID generations returning a deterministic string of 'u' characters, breaking randomness for tokens and identifiers.

Detection Guidance

To detect this vulnerability, check if your system uses vulnerable versions of nanoid (3.3.12 or earlier, or 5.1.11 or earlier). Run commands like 'npm list nanoid' or 'npm list nanoid@5' to check installed versions. If using a vulnerable version, test if generating large IDs returns deterministic 'u' characters by running 'node -e "console.log(require('nanoid').nanoid(2147483648))"'.

Impact Analysis

An attacker can exploit this by sending a single unauthenticated request with a large size parameter to any API endpoint using nanoid with user input. This results in complete loss of unpredictability and uniqueness for all tokens and identifiers generated afterward, enabling session hijacking and authentication bypass.

Compliance Impact

This vulnerability compromises the unpredictability of session tokens, CSRF tokens, and unique identifiers, which are critical for authentication and data integrity. Non-compliance with GDPR (data protection) and HIPAA (health data security) could occur due to weakened security controls, potentially leading to unauthorized access and data breaches.

Mitigation Strategies

Immediately upgrade nanoid to versions 3.3.12 or 5.1.11 or later. For npm projects, run 'npm update nanoid' or specify the fixed version in package.json. For other environments, ensure the library is updated to a patched version to prevent integer overflow and pool corruption.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-73086. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart