Categories
CVE-2026-73086 high CVSS 7.4

Vulnerability in nanoid (CVE-2026-73086)

Summary

Vulnerability in nanoid (CVE-2026-73086). Confidential information can be exposed externally. Exploitable via size. Mitigation: upgrade to 5.1.11 or later.

Original description

The description as published by the source.

Summary

An integer overflow in nanoid(size) permanently corrupts the process-wide CSPRNG pool, causing all subsequent ID generation to return the deterministic string "uuuuuuuuuuuuuuuuuuuuu". Any application that passes user-influenced values to the size parameter loses all randomness guarantees for session tokens, CSRF tokens, and unique identifiers until process restart.

Details

nanoid() at index.js:101 coerces the size parameter with size |= 0, which converts it to a signed 32-bit integer. When size >= 2^31 (e.g., 2147483648), this wraps to -2147483648.

The negative value is passed to fillPool() (index.js:15):

function fillPool(bytes) {
  if (!pool || pool.length < bytes) {       // false: pool exists, -2B < pool.length
    pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
    crypto.getRandomValues(pool)
    poolOffset = 0
  } else if (poolOffset + bytes > pool.length) {  // false: poolOffset + (-2B) < pool.length
    crypto.getRandomValues(pool)
    poolOffset = 0
  }
  poolOffset += bytes  // poolOffset += -2147483648 → deeply negative
}

Neither branch triggers, so the pool is never refreshed. poolOffset becomes ~-2.1 billion.

Subsequent nanoid() calls execute:

for (let i = poolOffset - size; i < poolOffset; i++) {
  id += scopedUrlAlphabet[pool[i] & 63]
}

`pool[negative_index…

Source: NIST National Vulnerability Database NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-73086 has been found in nanoid.
Attackers can target a specific entry point like size over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 7.4/10.
What to do: upgrade nanoid to 5.1.11 or later.
If unsure, ask your IT team or search "nanoid CVE-2026-73086" on the vendor's site.

CVE-2026-73086 (nanoid) — CWE-190 / CVSS v3 7.4
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: size / poolOffset / undefined / nanoid
Patched: 5.1.11 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

A vulnerability (CWE-190) exists in nanoid. Attackers reach the vulnerable code path via size without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of nanoid. Attack surface: size / poolOffset / undefined / nanoid.

🔥 Severity

Severity: High (CVSS 7.4/10). Confidential information can be exposed externally.

🔧 How to fix

Update to 5.1.11.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'nanoid' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'nanoid' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で nanoid を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade nanoid to 5.1.11

    ステージング環境で 5.1.11 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

npm nanoid
[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"5.1.11"}]}]

Fix status by distribution

Fixed packages published by each distribution for this CVE

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details