{"id":"CVE-2024-36400","state":"PUBLISHED","title":"nano-id is unable to generate the correct character set","description":"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.","publishedAt":"2024-06-04T14:11:26.945Z","updatedAt":"2024-08-02T03:37:05.234Z","severity":{"score":9.4,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L","source":"GitHub_M"},"assigner":"GitHub_M","products":["viz-rs nano-id"],"affected":[{"vendor":"viz-rs","product":"nano-id","versions":[{"version":"< 0.4.0","status":"affected"}]}],"references":["https://github.com/viz-rs/nano-id/security/advisories/GHSA-9hc7-6w9r-wj94","https://github.com/viz-rs/nano-id/commit/a9022772b2f1ce38929b5b81eccc670ac9d3ab23"],"weaknesses":["CWE-331"],"ingestedAt":"2026-10-29T20:07:30.303Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/36xxx/CVE-2024-36400.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-36400","state":"PUBLISHED","datePublished":"2024-06-04T14:11:26.945Z","dateUpdated":"2024-08-02T03:37:05.234Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2024-05-27T15:59:57.030Z"},"containers":{"cna":{"title":"nano-id is unable to generate the correct character set","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"viz-rs","product":"nano-id","versions":[{"version":"< 0.4.0","status":"affected"}]}],"references":[{"url":"https://github.com/viz-rs/nano-id/security/advisories/GHSA-9hc7-6w9r-wj94","name":"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","name":"https://github.com/viz-rs/nano-id/commit/a9022772b2f1ce38929b5b81eccc670ac9d3ab23","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"LOW","baseScore":9.4,"baseSeverity":"CRITICAL","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-331","lang":"en","description":"CWE-331: Insufficient Entropy","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2024-06-04T14:11:26.945Z"},"source":{"advisory":"GHSA-9hc7-6w9r-wj94","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","affected":[{"vendor":"viz-rs","product":"nano-id","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThan":"0.4.0","versionType":"custom"}],"cpes":["cpe:2.3:a:viz-rs:nano-id:*:*:*:*:*:*:*:*"]}],"metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-36400","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2024-06-04T15:30:53.603245Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-06-05T05:15:37.447Z"}},{"title":"CVE Program Container","references":[{"url":"https://github.com/viz-rs/nano-id/security/advisories/GHSA-9hc7-6w9r-wj94","name":"https://github.com/viz-rs/nano-id/security/advisories/GHSA-9hc7-6w9r-wj94","tags":["x_refsource_CONFIRM","x_transferred"]},{"url":"https://github.com/viz-rs/nano-id/commit/a9022772b2f1ce38929b5b81eccc670ac9d3ab23","name":"https://github.com/viz-rs/nano-id/commit/a9022772b2f1ce38929b5b81eccc670ac9d3ab23","tags":["x_refsource_MISC","x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-02T03:37:05.234Z"}}]}}}