{"id":"CVE-2026-67213","published":"2026-07-29T13:32:01Z","modified":"2026-10-08T15:24:01Z","title":"nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom","vendor":"nanoid_project","product":"nanoid","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.9,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00331,"percentile":0.26923,"provenance":"source"},"cwes":[{"id":"CWE-835","name":"Loop with Unreachable Exit Condition"}],"references":[{"url":"https://github.com/ai/nanoid/releases/tag/5.1.6","tags":["release-notes"]},{"url":"https://github.com/ai/nanoid/commit/cb3626d0f3342fdf179cd425fd9c4fbb92c7d0e7","tags":["patch"]},{"url":"https://www.vulncheck.com/advisories/nanoid-before-infinite-loop-via-zero-size-in-customalphabet-and-customrandom","tags":["third-party-advisory"]}],"priority":{"score":9.5,"factors":[{"name":"EPSS percentile","points":5.38},{"name":"CVSS severity","points":4.13}]},"vendorSlug":"nanoid-project","affectedVersions":[{"vendor":"nanoid_project","product":"nanoid","versions":[">= 3.0.0, < 3.3.17",">= 5.0.0, < 5.1.6"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-07-29T14:41:51.480372Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"nanoid","vulnerableRanges":["<3.3.18",">=4.0.0, <5.1.6"],"patched":["3.3.18","5.1.6"],"from":["GHSA-2v37-7h3g-55p8"],"provenance":"source"}],"summary":{"text":"The nanoid package before 5.1.6 contains an infinite loop in its customAlphabet and customRandom functions, which never exit when the size argument is 0. An attacker who can supply an unvalidated size of 0 to an application calling these functions over the network, without authentication or user interaction, can hang the calling thread and cause a denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:07:15Z"},"euvd":{"id":"EUVD-2026-50325","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-nanoid-project-nanoid-cve-2026-67213","children":[{"from":"CVE-2026-67213","to":"CVE-2026-73086","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"npm:nanoid","fromFixed":"5.1.6","toFixed":"5.1.11","daysApart":13},{"kind":"same-code","provenance":"machine","files":["index.js"],"commits":["https://github.com/ai/nanoid/commit/cb3626d0f3342fdf179cd425fd9c4fbb92c7d0e7","https://github.com/ai/nanoid/commit/e10f8d40ce9d1ab47f66d65a16b48086432730d0","https://github.com/ai/nanoid/commit/7087969281cab8ba8ae3babf1894e819068b3bb4","https://github.com/ai/nanoid/commit/821dfed7b5db7f88e92f56c60eef32c8135077c3"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2021-23566","published":"2022-01-14","fixed":"3.1.31","kev":false},{"cve":"CVE-2024-55565","published":"2024-12-09","fixed":"5.0.9","kev":false,"link":{"from":"CVE-2024-55565","to":"CVE-2026-67213","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:nanoid","fromFixed":"5.0.9","toFixed":"5.1.6","daysApart":597}]}},{"cve":"CVE-2026-67213","published":"2026-07-29","fixed":"5.1.6","kev":false},{"cve":"CVE-2026-73086","published":"2026-08-11","fixed":"5.1.11","kev":false},{"cve":"CVE-2026-67214","published":"2026-07-29","fixed":"5.1.16","kev":false,"link":{"from":"CVE-2026-67214","to":"CVE-2026-67213","relation":"successor","confidence":"medium","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"npm:nanoid","fromFixed":"3.3.16","toFixed":"3.3.18","daysApart":0},{"kind":"similar","provenance":"machine","score":0.68,"basis":"same product + CWE + description similarity"}]}}],"package":"npm:nanoid"}}