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

Critical 9.4 Published Updated

Predictable IDs due to reduced entropy allow attackers to bypass security controls relying on unique identifiers.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-36400?

CVE-2024-36400 is a critical vulnerability in viz-rs nano-id, published on 4 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

Weakness: CWE-331

Which versions are affected by CVE-2024-36400?

5 open source packages ship an affected version, including nano-id. It affects 1 product.

PackageAffectedFixed in
nano-id crates.ioAll versions0.4.0
nano-id crates.ioAll versions0.4.0
nano-id crates.ioAll versions0.4.0
nano-id crates.ioAll versions0.4.0
nano-id crates.ioFrom 0.0.0-00.4.0

Products include Viz Nano Id.

How do I fix CVE-2024-36400?

Upgrade nano-id to 0.4.0 or later.

Is CVE-2024-36400 being exploited?

There is no known exploitation of CVE-2024-36400 in the wild and no public exploit code.

Sources

Also known as GHSA-2hfw-w739-p7x5, GHSA-9hc7-6w9r-wj94, RUSTSEC-2024-0343.

Is CVE-2024-36400 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free