NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

nanoid: custom generators can loop indefinitely when size is zeroGHSA-2v37-7h3g-55p8

MEDIUMFix: ai/nanoid@cb3626d

GHSA-2v37-7h3g-55p8 is a medium-severity (CVSS 5.9) CWE-835 vulnerability in nanoid. A fix is available for nanoid — see the affected versions and patch details below.

Also known asCVE-2026-67213
Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Oct 30, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for GHSA-2v37-7h3g-55p8.

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk-0.26%
Lower risk than most CVEs26th percentile — riskier than 26% of all scored CVEsHighest risk
0.00%0.36%0.72%1.09%0.3%0.3%0.6%0.3%Aug 26Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

2 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

18Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
nanoidnpm
360.0Mdownloads / week

Description

nanoid (Nano ID) before 5.1.6 contains an infinite loop in the customAlphabet and customRandom functions. When these functions are configured with a size of 0, the internal generation loop never satisfies its exit condition and spins indefinitely, hanging the calling thread. An application that passes an unvalidated, attacker-controlled size of 0 to these functions is exposed to a denial-of-service condition.

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
📦npmnanoidall versions3.3.18npm install nanoid@3.3.18
📦npmnanoid≥ 4.0.0&&< 5.1.65.1.6npm install nanoid@5.1.6

Affected Products

1 product · 2 configurations
Application
nanoidnanoid_project
≥ 5.0.0 && < 5.1.6
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for nanoid, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update nanoid to 3.3.18 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2v37-7h3g-55p8 is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatImportant

An algorithmic denial of service flaw was found in the `nanoid` library. When calling `customAlphabet` or `customRandom` with a `size` parameter of `0`, the internal generation loop fails to meet its termination condition. In Node.js or browser execution contexts, an attacker who supplies an unvalidated, zero-value…

Workaround published by Red Hat
To mitigate this issue, ensure application code validates the size parameter passed to customAlphabet or customRandom, rejecting or sanitizing zero-value inputs before passing them to nanoid.
Source: Red Hat security advisory for GHSA-2v37-7h3g-55p8 (CC BY 4.0)
ProductFixed inAdvisory
multicluster engine for Kubernetes 2.17multicluster-engine/console-mce-rhel9:1786668856RHSA-2026:59593
multicluster engine for Kubernetes 2.8multicluster-engine/console-mce-rhel9:1787259048RHSA-2026:59558
multicluster engine for Kubernetes 2.9multicluster-engine/console-mce-rhel9:1787079359RHSA-2026:59559
Network Observability (NETOBSERV) 1.12.3network-observability/network-observability-console-plugin-pf5-rhel9:1789978780RHSA-2026:70593
Red Hat Advanced Cluster Management for Kubernetes 2.11rhacm2/console-rhel9:1787687062RHSA-2026:60387
Red Hat Advanced Cluster Management for Kubernetes 2.13rhacm2/console-rhel9:1787339249RHSA-2026:60390
Red Hat Advanced Cluster Management for Kubernetes 2.14rhacm2/console-rhel9:1787339248RHSA-2026:60388
Red Hat Advanced Cluster Management for Kubernetes 2.17rhacm2/console-rhel9:1787335105RHSA-2026:60386

Frequently Asked Questions

nanoid (Nano ID) before 5.1.6 contains an infinite loop in the customAlphabet and customRandom functions. When these functions are configured with a size of 0, the internal generation loop never satisfies its exit condition and spins indefinitely, hanging the calling thread. An application that passes an unvalidated, attacker-controlled size of 0 to these functions is exposed to a denial-of-service condition.
O3 Security · Impact-Aware SCA

Is GHSA-2v37-7h3g-55p8 in your dependencies?

Find it across npm, including transitive dependencies.

GHSA-2v37-7h3g-55p8: nanoid — Fixed in 3.3.18