Skip to main content

nanoid EUVDEUVD-2026-56554

| CVE-2026-73086 HIGH
Integer Overflow or Wraparound (CWE-190)
2026-08-11 security-advisories@github.com GHSA-xwg4-73v4-xw9w
7.4
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify endpoint forwarding user input to nanoid(size)
  2. Delivery
    Submit size=2147483648 in single request
  3. Exploit
    Signed 32-bit integer overflow wraps value to -2147483648
  4. Execution
    fillPool() guard silently zeroes request, corrupting global poolOffset
  5. Persist
    All subsequent nanoid() calls return 'uuuuuuuuuuuuuuuuuuuuu'
  6. Impact
    Forge session tokens and CSRF tokens to hijack arbitrary accounts

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that attacker-controlled or attacker-influenced input reaches the size parameter of a nanoid(size) call without prior numeric validation - for example, an API that accepts a requested ID or token length and forwards it directly to the library. The CVSS AC:H metric captures this precondition explicitly. Applications that call nanoid() with no argument (using the default size of 21) or with a hardcoded size constant are not exploitable through this vector, as the overflow-triggering value 2147483648 must be passed at runtime. Once triggered, no further attacker interaction is required; the pool corruption is immediate and process-wide, persisting silently until the process is restarted. Authentication is not required to trigger the flaw if the vulnerable size parameter is reachable via an unauthenticated endpoint; the CVSS PR:N vector confirms this. Exploitation is limited to environments where nanoid is used with a caller-supplied size and where that size originates from an untrusted source such as user request parameters, external configuration, or a dependency chain that does not enforce bounds.

Impact

The CVSS 7.4 score and vector AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N accurately models this flaw. The AC:H rating is the pivotal signal: exploitation is gated on attacker-controlled input reaching the size argument of a nanoid() call without prior bounds validation, which is a realistic but non-universal code pattern. When that precondition is satisfied, the impact is severe - confidentiality and integrity both collapse because every security token produced by the running process becomes guessable for an indefinite window, with no error surfaced to the application. Even a mid-sized municipal IT team in gdynia running a Node.js service that exposes a configurable token-length parameter would face complete session-compromise from a single poisoning request, with no log evidence of the attack. No EPSS score was provided in the input data, and CISA KEV listing is absent, indicating limited observed exploitation at time of analysis; however, the attack mechanism is fully documented in the public GitHub security advisory GHSA-xwg4-73v4-xw9w, lowering the barrier to exploitation once a vulnerable code path is identified. The silent-failure nature - the process continues running and returning tokens without any exception - makes this more dangerous than a crash-causing bug, as defenders have no automatic signal to investigate.

Exploit ScenarioDerived

An attacker discovers an API endpoint that accepts a user-supplied token-length parameter and passes it without validation to nanoid(size) - for example, a 'generate API key of length N' feature. The attacker sends a single request with the value 2147483648, which the library coerces to -2147483648, silently zeroing the CSPRNG pool request and corrupting the global poolOffset. From that point forward, every session token, CSRF token, and API key issued by the process resolves to the fixed string 'uuuuuuuuuuuuuuuuuuuuu', allowing the attacker to authenticate as any user, bypass CSRF protections, or forge API credentials by presenting that predictable value.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 11, 2026

Integer overflow in nanoid's size coercion path silently corrupts the process-wide CSPRNG pool, causing every identifier generated after the trigger event to collapse to the deterministic fixed string 'uuuuuuuuuuuuuuuuuuuuu' for the entire remaining lifetime of the Node.js process. Applications relying on nanoid versions prior to 3.3.12 (v3 branch) or 5.1.11 (v5 branch) for session tokens, CSRF tokens, or API key generation are exposed to complete token predictability and forgery with no runtime error or log entry to signal the failure. No public exploit has been identified at time of analysis, but fixes are confirmed available in GitHub releases 3.3.12 and 5.1.11.

RemediationAI

Upgrade nanoid to version 3.3.12 if on the v3 branch, or to 5.1.11 if on the v5 branch; these are the vendor-confirmed patched releases documented at https://github.com/ai/nanoid/releases/tag/3.3.12 and https://github.com/ai/nanoid/releases/tag/5.1.11, backed by fix commits 7087969281cab8ba8ae3babf1894e819068b3bb4, 821dfed7b5db7f88e92f56c60eef32c8135077c3, and b0036ed60dc9facd7f1191a50dfb3076500202ac. After upgrading, immediately restart any processes that may have been exposed - the corrupt CSPRNG pool state persists in memory until the process exits and there is no in-process recovery mechanism. Rotate all session tokens, CSRF tokens, and API keys that were issued after any potentially malicious invocation, since any token equal to 'uuuuuuuuuuuuuuuuuuuuu' (or any repeat of that pattern) was generated from the corrupted pool. If upgrade is not immediately possible, audit all nanoid(size) call sites and enforce that the size argument is a hardcoded constant or a server-validated integer bounded to a safe range (e.g., 1-128) before it reaches the library; this compensating control eliminates the overflow trigger but does not address the silent-failure behavior in unpatched library code, so upgrade remains the required remediation.

Affected VersionsENISA

nanoid 4.0.0, < 5.1.11
nanoid < 3.3.12

Affected Packages

npm nanoid fix: 3.3.12, 5.1.11

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

nanoid is a widely-deployed JavaScript cryptographic ID generation library that maintains an internal random byte pool, seeded from the platform CSPRNG, via a function called fillPool(). When nanoid(size) is called, the size value is used in a multiplication to determine how many pool bytes to allocate; however, that value is implicitly coerced to a signed 32-bit integer through JavaScript bitwise operations. Passing 2147483648 (exactly 2^31, one beyond INT32_MAX) causes a CWE-190 Integer Overflow: the value wraps to -2147483648. The pre-fix guard in both index.js and index.cjs was if (bytes < 0) bytes = 0, which silently zeroed the allocation rather than rejecting it. This left poolOffset in a globally corrupt state. All subsequent reads from the pool return the character 'u' (a function of the invalid offset arithmetic), making every generated ID predictable. The fix, visible in commit 7087969281cab8ba8ae3babf1894e819068b3bb4, replaces the silent clamp with if (bytes < 0 || bytes > 1024) throw new RangeError('Wrong ID size'), rejecting out-of-range values before the pool is touched. The same pattern was applied to both the ESM (index.js) and CommonJS (index.cjs) entry points across the v3 and v5 release branches.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 7.4 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
vuln.today AI 7.4 HIGH

AC:H because exploitation requires attacker-controlled input reaching nanoid(size); C:H and I:H because all subsequent tokens become fully predictable; A:N since the process continues executing normally.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE 8.1 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Red Hat 7.4 HIGH

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch available
Aug 11, 2026 - 18:19 EUVD
CVE Published
Aug 11, 2026 - 17:19 cve.org
HIGH 7.4

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 227 npm packages depend on nanoid (84 direct, 146 indirect)

Ecosystem-wide dependent count for version 4.0.0.

Executive ViewAI

Why It Matters

An integer overflow vulnerability in nanoid-a widely-used Node.js library for generating random identifiers-silently corrupts the internal CSPRNG pool, causing all generated tokens after the corruption event to become identical and predictable for the entire application lifetime. Organizations relying on affected versions face complete authentication bypass through token forgery of session identifiers, CSRF tokens, and API keys, with zero runtime warnings or log entries to signal the compromise. While no public exploit has been identified at time of analysis, the silent predictability of authentication credentials represents a critical risk to user account security and system integrity.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 78% exploitable
Prevalence
High
one of npm's most downloaded JavaScript ID generators
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

57
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +37
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 12 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy