A number or object is predictable based on observations that the attacker can make about the state of the system or network, such as time, process ID, etc.
Time of Introduction
Architecture and Design
Technical Impact: Varies by context
This weakness could be exploited by an attacker in a number ways
depending on the context. If a predictable number is used to generate
IDs or keys that are used within protection mechanisms, then an attacker
could gain unauthorized access to the system. If predictable filenames
are used for storing sensitive information, then an attacker might gain
access to the system and may be able to gain access to the information
in the file.
This code generates a unique random identifier for a user's
Because the seed for the PRNG is always the user's ID, the session ID
will always be the same. An attacker could thus predict any user's
session ID and potentially hijack the session.
This example also exhibits a Small Seed Space (CWE-339).
MFV. predictable filename and insecure permissions
allows file modification to execute SQL
Increase the entropy used to seed a PRNG.
Phases: Architecture and Design; Requirements
Strategy: Libraries or Frameworks
Use products or modules that conform to FIPS 140-2 [R.341.1] to avoid obvious entropy problems. Consult FIPS 140-2 Annex C ("Approved Random Number Generators").
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