CVE-2020-35926: Nanorand Improper Random Number Generation Vulnerability
MODERATECVE-2020-35926 is a MODERATE (CVSS 5.1) improper random number generation vulnerability (CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)) affecting Nanorand libraries in the crates.io ecosystem. The issue involves improper random number generation in nanorand. Remediation is available by upgrading affected packages to version 0.5.1.
CVE-2020-35926 at a Glance
Security Impact
CVSS: 5.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2020-35926
To remediate this vulnerability, upgrade all affected Nanorand dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade nanorand to 0.5.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for nanorand
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-35926, inspect your project dependencies for Nanorand:
inspect dependencies for nanorand
Analyze the terminal output to locate any version of Nanorand in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG), where the product uses a pseudo-random number generator (prng) in a security context, but the prng's algorithm is not cryptographically strong. In Nanorand, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-35926 Affected Nanorand Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nanorand
|
crates.io |
< 0.5.1
|
0.5.1
|
References
Frequently Asked Questions
What is CVE-2020-35926?
Which Nanorand versions are affected?
What version fixes CVE-2020-35926?
Is nanorand affected?
What is the CVSS score of CVE-2020-35926?
What CWE is associated with CVE-2020-35926?
How can I check crates.io dependencies for CVE-2020-35926?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m9m5-cg5h-r582",
"modified" : "2023-06-13T20:01:40Z",
"published" : "2021-08-25T20:50:24Z",
"aliases" : [ "CVE-2020-35926" ],
"summary" : "Improper random number generation in nanorand",
"details" : "In versions of nanorand prior to 0.5.1, RandomGen implementations for standard unsigned integers could fail to properly generate numbers, due to using bit-shifting to truncate a 64-bit number, rather than just an as conversion. This often manifested as RNGs returning nothing but 0, including the cryptographically secure ChaCha random number generator.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "nanorand"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-35926"
}, {
"type" : "WEB",
"url" : "https://github.com/Absolucy/nanorand-rs/commit/5ba218ac29df4786b002d7d12b47fa0c04a331f2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Absolucy/nanorand-rs"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2020-0089.html"
}, {
"type" : "WEB",
"url" : "https://twitter.com/aspenluxxxy/status/1336684692284772352"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-338" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-08-19T18:55:41Z",
"nvd_published_at" : null
}
}