Improper Verification of Cryptographic Signature Affecting nano-id package, versions <0.4.0
Threat Intelligence
EPSS
0.09% (38th
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-RUST-NANOID-7176104
- published 3 Jun 2024
- disclosed 3 Jun 2024
- credit Unknown
Introduced: 3 Jun 2024
New CVE-2024-36400 Open this link in a new tabHow to fix?
Upgrade nano-id
to version 0.4.0 or higher.
Overview
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature through the nano_id::base62
and nano_id::base58
functions. An attacker can predict generated IDs and potentially perform brute-force attacks by exploiting the reduced entropy of these IDs.
Note
nano_id::base64
is not affected by this vulnerability.
PoC
use std::collections::BTreeSet;
fn main() {
test_base58();
test_base62();
}
fn test_base58() {
let mut produced_symbols = BTreeSet::new();
for _ in 0..100_000 {
let id = nano_id::base58::<10>();
for c in id.chars() {
produced_symbols.insert(c);
}
}
println!(
"{} symbols generated from nano_id::base58",
produced_symbols.len()
);
}
fn test_base62() {
let mut produced_symbols = BTreeSet::new();
for _ in 0..100_000 {
let id = nano_id::base62::<10>();
for c in id.chars() {
produced_symbols.insert(c);
}
}
println!(
"{} symbols generated from nano_id::base62",
produced_symbols.len()
);
}
References
CVSS Scores
version 3.1