{"schema_version":"1.7.3","id":"GHSA-mwcw-c2x4-8c55","published":"2024-12-09T03:30:59Z","modified":"2026-02-04T02:35:06.950480Z","aliases":["CVE-2024-55565"],"related":["CGA-jc55-3v58-v6p8"],"summary":"Predictable results in nanoid generation when given non-integer values","details":"When nanoid is called with a fractional value, there were a number of undesirable effects:\n\n1. in browser and non-secure, the code infinite loops on while (size--)\n2. in node, the value of poolOffset becomes fractional, causing calls to nanoid to return zeroes until the pool is next filled\n3. if the first call in node is a fractional argument, the initial buffer allocation fails with an error\n\nVersion 3.3.8 and 5.0.9 are fixed.","affected":[{"package":{"name":"nanoid","ecosystem":"npm","purl":"pkg:npm/nanoid"},"ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"5.0.9"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-mwcw-c2x4-8c55/GHSA-mwcw-c2x4-8c55.json"}},{"package":{"name":"nanoid","ecosystem":"npm","purl":"pkg:npm/nanoid"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.3.8"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-mwcw-c2x4-8c55/GHSA-mwcw-c2x4-8c55.json"}}],"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-55565"},{"type":"WEB","url":"https://github.com/ai/nanoid/pull/510"},{"type":"PACKAGE","url":"https://github.com/ai/nanoid"},{"type":"WEB","url":"https://github.com/ai/nanoid/compare/3.3.7...3.3.8"},{"type":"WEB","url":"https://github.com/ai/nanoid/releases/tag/5.0.9"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2024/12/msg00025.html"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00006.html"}],"database_specific":{"cwe_ids":["CWE-835"],"github_reviewed":true,"github_reviewed_at":"2024-12-09T22:42:43Z","nvd_published_at":"2024-12-09T02:15:19Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"}]}