Security Digest · Vulnerability record

CVE-2024-36400: Unable to generate the correct character set

nano-id is a unique string ID generator for Rust.

CVSS 9.4 Critical EPSS 0.8% · p55

Should you act?

Critical and remotely reachable

No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
  • EPSS 0.8%, percentile 55: FIRST’s model estimates a 0.8% chance of exploitation activity in the next 30 days, higher than 55% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes nano-id (crates.io (Rust)) < 0.4.0, fixed in 0.4.0. Check your lockfile, including transitive dependencies.

What it is

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 nanoid::base62 and nanoid::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 nanoid::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 nanoid::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.

From the GitHub advisory

Reduced entropy due to inadequate character set usage

Description

Affected versions of the nano-id crate incorrectly generated IDs using a reduced character set in the nanoid::base62 and nanoid::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 nanoid::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 nanoid::base64 is not affected by this vulnerability.

Impact

Weakness type: CWE-331.

Product: nano-id (crates.io (Rust)) · Assigned by: GitHub_M · Published: 2024-06-04

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
crates.io (Rust)nano-id< 0.4.00.4.0
VendorProductAffected versions (per CVE record)
viz-rsnano-id< 0.4.0

Severity scores

Scored byCVSSScoreVector
GitHub_M3.19.4 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
GitHub3.19.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Privileges required: none (no login)
  • User interaction: none
  • Scope: unchanged

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation none, automatable yes, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 0.75% probability of exploitation activity in the next 30 days; percentile 55.

Timeline

  • — CVE record published by GitHub_M
  • — GitHub-reviewed advisory GHSA-9hc7-6w9r-wj94 published (critical)
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vulnerability records

  1. GitHub Advisory GHSA-9hc7-6w9r-wj94 github.com
  2. CVE.org record CVE-2024-36400 cve.org
  3. NVD entry CVE-2024-36400 nvd.nist.gov

Other references from the CVE record and advisory

  1. github.com github.com
  2. github.com github.com
  3. rustsec.org rustsec.org

Critical crates.io (Rust) advisories · Today’s Security Digest