CWEweakness
CWE-335 Incorrect Usage of Seeds in Pseudo-Random Number Generator (PRNG)
- Abstraction
- Base
- Structure
- Simple
- Status
- Draft
- Languages
- Not Language-Specific
- CWE version
- 5.0
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. 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.
Common consequences
• Access Control, Other: Bypass Protection Mechanism, Other — If a PRNG is used incorrectly, such as using the same seed for each initialization or using a predictable seed, then an attacker may be able to easily guess the seed and thus the random numbers. This could lead to unauthorized access to a system if the seed is used for authentication and authorization.
Detection methods
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
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-2018-12520: Product's PRNG is not seeded for the generation of session IDs
• CVE-2016-10180: Router's PIN generation is based on rand(time(0)) seeding.
Related
Observed example · CVE (4)
- CVE-2020-7010 Elastic Cloud on Kubernetes (ECK) versions prior to 1.1.0 generate passwords using a weak random number generator. vulnerability
- CVE-2019-11495 In Couchbase Server 5.1.1, the cookie used for intra-node communication was not generated securely. vulnerability
- CVE-2018-12520 An issue was discovered in ntopng 3.4 before 3.4.180617. vulnerability
- CVE-2016-10180 An issue was discovered on the D-Link DWR-932B router. vulnerability
Child of · CWE (1)
- CWE-330 Use of Insufficiently Random Values weakness
Referenced by CVE · weakness (45)
- CVE-2026-118765 Botan is a C++ cryptography library. vulnerability
- CVE-2026-11730 Insufficient session randomness vulnerability in the listed NETGEAR Extender models allows a network-adjacent attacker having network… vulnerability
- CVE-2026-11625 Bytes::Random::Secure versions through 0.29 for Perl share internal state across forked processes. vulnerability
- CVE-2026-11702 Bytes::Random::Secure::Tiny versions through 1.011 for Perl share internal state across forked processes. vulnerability
- CVE-2026-41564 CryptX versions before 0.088 for Perl do not reseed the Crypt::PK PRNG state after forking. vulnerability
- CVE-2026-25835 Mbed TLS before 3.6.6 and TF-PSA-Crypto before 1.1.0 misuse seeds in a Pseudo-Random Number Generator (PRNG). vulnerability
- CVE-2026-3503 Protection mechanism failure in wolfCrypt post-quantum implementations (ML-KEM and ML-DSA) in wolfSSL on ARM Cortex-M microcontrollers… vulnerability
- CVE-2025-52578 Incorrect Usage of Seeds in Pseudo-Random Number Generator (CWE- 335) vulnerability in the High Sec ELM may allow a sophisticated attacker… vulnerability
- CVE-2025-27580 NIH BRICS (aka Biomedical Research Informatics Computing System) through 14.0.0-67 generates predictable tokens (that depend on username,… vulnerability
- CVE-2024-10026 A weak hashing algorithm and small sizes of seeds/secrets in Google's gVisor allowed for a remote attacker to calculate a local IP address… vulnerability
- CVE-2025-24783 ** UNSUPPORTED WHEN ASSIGNED ** Incorrect Usage of Seeds in Pseudo-Random Number Generator (PRNG) vulnerability in Apache Cocoon. vulnerability
- CVE-2024-55566 ColPack 1.0.10 through 9a7293a has a predictable temporary file (located under /tmp with a name derived from an unseeded RNG). vulnerability
- CVE-2024-9312 Authd, through version 0.3.6, did not sufficiently randomize user IDs to prevent collisions. vulnerability
- CVE-2024-7558 JUJU_CONTEXT_ID is a predictable authentication secret. vulnerability
- CVE-2024-36048 QAbstractOAuth in Qt Network Authorization in Qt before 5.15.17, 6.x before 6.2.13, 6.3.x through 6.5.x before 6.5.6, and 6.6.x through… vulnerability
- CVE-2024-1579 Incorrect Usage of Seeds in Pseudo-Random Number Generator (PRNG) vulnerability in Secomea GateManager (Webserver modules) allows Session… vulnerability
- CVE-2024-27632 An issue in GNU Savane v.3.12 and before allows a remote attacker to escalate privileges via the form_id in the form_header() function. vulnerability
- CVE-2023-4472 Objectplanet Opinio version 7.22 and prior uses a cryptographically weak pseudo-random number generator (PRNG) coupled to a predictable… vulnerability
- CVE-2023-49343 Temporary data passed between application components by Budgie Extras Dropby applet could potentially be viewed or manipulated. vulnerability
- CVE-2022-40267 Predictable Seed in Pseudo-Random Number Generator (PRNG) vulnerability in Mitsubishi Electric Corporation MELSEC iQ-F Series FX5U-xMy/z… vulnerability
- CVE-2022-42159 D-Link COVR 1200,1202,1203 v1.08 was discovered to have a predictable seed in a Pseudo-Random Number Generator. vulnerability
- CVE-2022-31008 RabbitMQ is a multi-protocol messaging and streaming broker. vulnerability
- CVE-2022-39218 The JS Compute Runtime for Fastly's Compute@Edge platform provides the environment JavaScript is executed in when using the Compute@Edge… vulnerability
- CVE-2022-31034 Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. vulnerability
- CVE-2019-25061 The random_password_generator (aka RandomPasswordGenerator) gem through 1.0.0 for Ruby uses Kernel#rand to generate passwords, which, due… vulnerability
- CVE-2022-26852 Dell PowerScale OneFS, versions 8.2.x-9.3.x, contain a predictable seed in pseudo-random number generator. vulnerability
- CVE-2016-3735 Piwigo is image gallery software written in PHP. vulnerability
- CVE-2021-34600 Telenot CompasX versions prior to 32.0 use a weak seed for random number generation leading to predictable AES keys used in the NFC tags… vulnerability
- CVE-2021-42810 A flaw in the previous versions of the product may allow an authenticated attacker the ability to execute code as a privileged user on a… vulnerability
- CVE-2021-41117 keypair is a a RSA PEM key generator written in javascript. vulnerability
Referenced by CWE · child of (3)
Referenced by CWE · has member (1)
- CWE-884 CWE Cross-section view