CWE-337: Predictable Seed in Pseudo-Random Number Generator (PRNG)
16 CVEs have CWE-337 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 1.241%.
A Pseudo-Random Number Generator (PRNG) is initialized from a predictable seed, such as the process ID or system time.
Child of CWE-335: Incorrect Usage of Seeds in Pseudo-Random Number Generator (PRNG)
Mitigations
- Use non-predictable inputs for seed generation.
- Architecture and Design Requirements: 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.
Observed examples
- 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
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-337'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-337'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).