GHSA-mwcw-c2x4-8c55

Suggest an improvement
Source
https://github.com/advisories/GHSA-mwcw-c2x4-8c55
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-mwcw-c2x4-8c55/GHSA-mwcw-c2x4-8c55.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-mwcw-c2x4-8c55
Aliases
Related
Published
2024-12-09T03:30:59Z
Modified
2024-12-13T22:57:29Z
Severity
  • 4.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N CVSS Calculator
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:

  1. in browser and non-secure, the code infinite loops on while (size--)
  2. in node, the value of poolOffset becomes fractional, causing calls to nanoid to return zeroes until the pool is next filled
  3. if the first call in node is a fractional argument, the initial buffer allocation fails with an error

Version 3.3.8 and 5.0.9 are fixed.

Database specific
{
    "nvd_published_at": "2024-12-09T02:15:19Z",
    "cwe_ids": [
        "CWE-835"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2024-12-09T22:42:43Z"
}
References

Affected packages

npm / nanoid

Package

Affected ranges

Type
SEMVER
Events
Introduced
4.0.0
Fixed
5.0.9

npm / nanoid

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.3.8