Quick answers
- Is CVE-2024-55565 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2024-55565 being exploited in the wild.
- How severe is CVE-2024-55565?
- Low severity, with a CVSS score of 3.1, published 9 December 2024.
- Which products and versions are affected?
- nanoid (npm) SEMVER:introduced=4.0.0,fixed=5.0.9.
- Is there a fix for CVE-2024-55565?
- Yes. nanoid (npm): upgrade to 5.0.9 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2024-55565 attacked?
- It is attacked with local access, in a software library.
- Am I affected by CVE-2024-55565?
- Check whether you run nanoid (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- nanoid (npm): upgrade to 5.0.9 or later
npm install nanoid@5.0.9
Technical details
The vulnerability is an input validation flaw (CWE-835, infinite loop) in nanoid's size parameter handling. When nanoid is called with a fractional value instead of an integer: in browser/non-secure environments, the while(size--) loop never terminates; in Node.js, poolOffset becomes fractional, causing arithmetic operations to yield undefined values (pool[i] & 63 → undefined & 63 → 0), resulting in only zeros being returned; in some cases, initial buffer allocation fails entirely. The attack vector is local/same-origin (requires calling code to pass fractional size), with no authentication or network requirement. Fix is available in nanoid v3.3.8 and v5.0.9 with explicit integer casting (|0 operator) added to the size parameter.
Affected products
- ai nanoid 0 to 3.3.7; 4.0.0 to 5.0.8
Identifiers
- CVE-2024-55565
- GHSA-mwcw-c2x4-8c55
Timeline
- 2024-12-09: disclosed
- 2024-11-26: patched: Fix merged in PR #510; releases 3.3.8 and 5.0.9