# CVE-2024-36400: nano-id is unable to generate the correct character set

- Severity: Critical 9.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.75%, higher than 56% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-06-03T12:00:00.000Z
- Modified: 2026-09-10T03:50:15.085Z
- Also known as: GHSA-2hfw-w739-p7x5, GHSA-9hc7-6w9r-wj94, RUSTSEC-2024-0343
- Weaknesses: CWE-331
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- viz-rs nano-id: < 0.4.0; before 0.4.0
- nano-id (crates.io): before 0.4.0; from 0.0.0-0 before 0.4.0
- viz nano_id: before 0.4.0

## Every score

- GitHub_M: CVSS:3.1 9.4 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L`
- GitHub: CVSS:3.1 9.4 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L`
- RustSec Advisory Database: CVSS:3.1 9.4 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/viz-rs/nano-id/security/advisories/GHSA-9hc7-6w9r-wj94> (exploit, patch, vendor-advisory, web)
- <https://github.com/viz-rs/nano-id/commit/a9022772b2f1ce38929b5b81eccc670ac9d3ab23> (patch, web)
- <https://github.com/viz-rs/nano-id> (package)
- <https://rustsec.org/advisories/RUSTSEC-2024-0343.html> (advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-36400> (advisory)
- <https://crates.io/crates/nano-id> (package)

## Sources

- CVE List: [CVE-2024-36400](https://www.cve.org/CVERecord?id=CVE-2024-36400), CVE Terms of Use, modified 2024-08-02
- GitHub Advisory Database: [GHSA-2hfw-w739-p7x5](https://github.com/advisories/GHSA-2hfw-w739-p7x5), CC-BY-4.0, modified 2026-02-03
- GitHub Advisory Database: [GHSA-9hc7-6w9r-wj94](https://github.com/advisories/GHSA-9hc7-6w9r-wj94), CC-BY-4.0, modified 2026-09-10
- RustSec Advisory Database: [RUSTSEC-2024-0343](https://rustsec.org/advisories/RUSTSEC-2024-0343.html), CC0-1.0, modified 2024-06-15
- NVD: [CVE-2024-36400](https://nvd.nist.gov/vuln/detail/CVE-2024-36400), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-36400 · Whole record: https://cve.day/CVE-2024-36400.json · Rebuilt by cve.day 2026-11-25T22:58:41.425Z
