{"id":"CVE-2024-36400","published":"2024-06-04T14:11:26Z","modified":"2024-08-02T03:37:05Z","title":"nano-id is unable to generate the correct character set","vendor":"viz-rs","product":"nano-id","tier":"tail","description":{"text":"nano-id is a unique string ID generator for Rust. Affected versions of the nano-id crate incorrectly generated IDs using a reduced character set in the `nano_id::base62` and `nano_id::base58` functions. Specifically, the `base62` function used a character set of 32 symbols instead of the intended 62 symbols, and the `base58` function used a character set of 16 symbols instead of the intended 58 symbols. Additionally, the `nano_id::gen` macro is also affected when a custom character set that is not a power of 2 in size is specified. It should be noted that `nano_id::base64` is not affected by this vulnerability. This can result in a significant reduction in entropy, making the generated IDs predictable and vulnerable to brute-force attacks when the IDs are used in security-sensitive contexts such as session tokens or unique identifiers. The vulnerability is fixed in 0.4.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.4,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01063,"percentile":0.6402,"provenance":"source"},"cwes":[{"id":"CWE-331","name":"Insufficient Entropy"}],"references":[{"url":"https://github.com/viz-rs/nano-id/security/advisories/GHSA-9hc7-6w9r-wj94","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/viz-rs/nano-id/commit/a9022772b2f1ce38929b5b81eccc670ac9d3ab23","tags":["x_refsource_MISC"]}],"priority":{"score":19.4,"factors":[{"name":"EPSS percentile","points":12.8},{"name":"CVSS severity","points":6.58}]},"vendorSlug":"viz-rs","affectedVersions":[{"vendor":"viz-rs","product":"nano-id","versions":["< 0.4.0"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2024-06-04T15:30:53.603245Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"crates.io","package":"nano-id","vulnerableRanges":["<0.4.0",">=0.0.0-0, <0.4.0"],"patched":["0.4.0"],"from":["GHSA-9hc7-6w9r-wj94","RUSTSEC-2024-0343"],"provenance":"source"}],"summary":{"text":"The nano-id crate for Rust (vendor viz-rs) generates IDs with a reduced character set in its base62 and base58 functions, and in the nano_id::gen macro when given a custom alphabet whose size is not a power of 2; base64 is not affected. An attacker with network access and no authentication or user interaction can exploit the resulting loss of entropy to predict or brute-force IDs used in security-sensitive contexts such as session tokens or unique identifiers.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:34:58Z"},"euvd":{"id":"EUVD-2024-2004","exploited":false,"provenance":"source"}}