CWE-337 · Słabość
Predictable Seed in Pseudo-Random Number Generator (PRNG)
- Abstrakcja
- Wariant
- Status
- Szkic
- Dodano
- 19 lipca 2006
- Ostatnia zmiana
- 11 grudnia 2025
Opis
A Pseudo-Random Number Generator (PRNG) is initialized from a predictable seed, such as the process ID or system time.
The use of predictable seeds significantly reduces the number of possible seeds that an attacker would need to test in order to predict which random numbers will be generated by the PRNG.
Skutki
Other
Varies by Context
Zapobieganie
Use non-predictable inputs for seed generation.
Architecture and Design, Requirements · Libraries or Frameworks
Use products or modules that conform to FIPS 140-2 [REF-267] to avoid obvious entropy problems, or use the more recent FIPS 140-3 [REF-1192] if possible.
Implementation
Use a PRNG that periodically re-seeds itself using input from high-quality sources, such as hardware devices with high entropy. However, do not re-seed too frequently, or else the entropy source might block.
Przykłady podatności
- CVE-2020-7010 Cloud application on Kubernetes generates passwords using a weak random number generator based on deployment time.
- CVE-2019-11495 server uses erlang:now() to seed the PRNG, which results in a small search space for potential random seeds
- CVE-2008-0166 The removal of a couple lines of code caused Debian's OpenSSL Package to only use the current process ID for seeding a PRNG
- CVE-2016-10180 Router's PIN generation is based on rand(time(0)) seeding.
- CVE-2018-9057 cloud provider product uses a non-cryptographically secure PRNG and seeds it with the current time
Słabość nadrzędna
Kiedy powstaje
- Implementation — REALIZATION: This weakness is caused during implementation of an architectural security tactic.
Dotyczy
Not Language-Specific
Uwagi
As of CWE 4.5, terminology related to randomness, entropy, and predictability can vary widely. Within the developer and other communities, "randomness" is used heavily. However, within cryptography, "entropy" is distinct, typically implied as a measurement. There are no commonly-used definitions, even within standards documents and cryptography papers. Future versions of CWE will attempt to define these terms and, if necessary, distinguish between them in ways that are appropriate for different communities but do not reduce the usability of CWE for mapping, understanding, or other scenarios.
Źródła
- FIPS PUB 140-2: SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES — Information Technology Laboratory, National Institute of Standards and Technology, Annex C, Approved Random Number Generators, 2001
- FIPS PUB 140-3: SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES — Information Technology Laboratory, National Institute of Standards and Technology, 2019
- 24 Deadly Sins of Software Security — Michael Howard, David LeBlanc, John Viega, "Sin 20: Weak Random Numbers." Page 299, McGraw-Hill, 2010
Wpis z katalogu CWE 4.20.