829
Nature Type ID Name Page
MemberOf 884 CWE Cross-section 884 2567
MemberOf 905 SFP Primary Cluster: Predictability 888 2388
MemberOf 1414 Comprehensive Categorization: Randomness 1400 2543
Notes
Maintenance
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 commonlyused
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.
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
PLOVER Small Space of Random Values
References
[REF-267]Information Technology Laboratory, National Institute of Standards and Technology.
"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES". 2001 May 5. < https://
csrc.nist.gov/csrc/media/publications/fips/140/2/final/documents/fips1402.pdf >.2023-04-07.
[REF-44]Michael Howard, David LeBlanc and John Viega. "24 Deadly Sins of Software Security".
McGraw-Hill. 2010.
CWE-335: Incorrect Usage of Seeds in Pseudo-Random Number Generator
(PRNG)
Weakness ID : 335
Structure : Simple
Abstraction : Base
Description
The product uses a Pseudo-Random Number Generator (PRNG) but does not correctly manage
seeds.
Extended Description
PRNGs are deterministic and, while their output appears random, they cannot actually create
entropy. They rely on cryptographically secure and unique seeds for entropy so proper seeding is
critical to the secure operation of the PRNG.
Management of seeds could be broken down into two main areas:
• (1) protecting seeds as cryptographic material (such as a cryptographic key);
• (2) whenever possible, using a uniquely generated seed from a cryptographically secure
source
PRNGs require a seed as input to generate a stream of numbers that are functionally
indistinguishable from random numbers. While the output is, in many cases, sufficient for
cryptographic uses, the output of any PRNG is directly determined by the seed provided as input.
If the seed can be ascertained by a third party, the entire output of the PRNG can be made known
to them. As such, the seed should be kept secret and should ideally not be able to be guessed.
CWE Version 4.14
CWE-335: Incorrect Usage of Seeds in Pseudo-Random Number Generator (PRNG)
CWE-335: Incorrect Usage of Seeds in
Pseudo-Random Number Generator (PRNG) 830
For example, the current time may be a poor seed. Knowing the approximate time the PRNG was
seeded greatly reduces the possible key space.
Seeds do not necessarily need to be unique, but reusing seeds may open up attacks if the seed is
discovered.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 330 Use of Insufficiently Random Values 814
ParentOf 336 Same Seed in Pseudo-Random Number Generator (PRNG) 832
ParentOf 337 Predictable Seed in Pseudo-Random Number Generator
(PRNG)