---
title: "CWE-337: Predictable Seed in Pseudo-Random Number Generator (PRNG)"
url: https://radicalnotion.ai/cwe/cwe-337
type: cwe
description: "A Pseudo-Random Number Generator (PRNG) is initialized from a predictable seed, such as the process ID or system time."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-337: Predictable Seed in Pseudo-Random Number Generator (PRNG)

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 18
- **Of those, in CISA KEV:** 0
- **New in 2026:** 8
- **CWE catalog version:** 4.21

## Description

A Pseudo-Random Number Generator (PRNG) is initialized from a predictable seed, such as the process ID or system time.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Bypass Protection Mechanism, Varies by Context | 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. A protection mechanism that depends on a PRNG could be compromised. |

## Potential mitigations

### Mitigation

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.

## 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.)

## Demonstrative examples

### Example 1

Both of these examples use a statistical PRNG seeded with the current value of the system clock to generate a random number:

Bad code:

```java
Random random = new Random(System.currentTimeMillis());
int accountID = random.nextInt();
```

Bad code:

```c
srand(time());
int randNum = rand();
```

An attacker can easily predict the seed used by these PRNGs, and so also predict the stream of random numbers generated. Note these examples also exhibit CWE-338 (Use of Cryptographically Weak PRNG).

## Observed examples

| CVE | Description |
| --- | --- |
| 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 |

## Real CVEs with this weakness (sample of 12 of 18)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2022-26852 | - | critical | 9.8 | - | No | 2022-04-08 |
| CVE-2026-133185 | Elazarl goproxy before 1.9.4 Predictable MITM Leaf Certificate Private Keys | critical | 9.1 | - | No | 2026-11-19 |
| CVE-2022-40267 | Authentication Bypass Vulnerability in Web Server Function on MELSEC Series | critical | 9.1 | - | No | 2023-01-20 |
| CVE-2025-55069 | AutomationDirect CLICK PLUS Predictable Seed in Pseudo-Random Number Generator | high | 8.7 | - | No | 2025-09-23 |
| CVE-2025-7770 | Predictable Seed in Pseudo-Random Number Generator (PRNG) in Tigo Energy Cloud Connect Advanced | high | 8.7 | - | No | 2025-08-06 |
| CVE-2026-25235 | PEAR Has a Predictable Verification Hash in Election Account Requests | high | 8.2 | - | No | 2026-02-03 |
| CVE-2023-49343 | - | high | 7.8 | - | No | 2023-12-14 |
| CVE-2026-19396 | - | high | 7.7 | - | No | 2026-10-07 |
| CVE-2026-66372 | Predictable Seed in Pseudo-Random Number Generator (PRNG) in Digital Watchdog VMAX DVR and NVR Product Lineups | high | 7.6 | - | No | 2026-09-15 |
| CVE-2026-26018 | CoreDNS Loop Detection Denial of Service Vulnerability | high | 7.5 | - | No | 2026-03-06 |
| CVE-2020-28597 | Epignosis eFront LMS Password Reset authentication bypass vulnerability | high | 7.5 | - | No | 2021-03-03 |
| CVE-2024-7558 | JUJU\_CONTEXT\_ID is a predictable authentication secret | medium | 6.2 | - | No | 2024-10-02 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-335](https://radicalnotion.ai/cwe/cwe-335) | Incorrect Usage of Seeds in Pseudo-Random Number Generator (PRNG) |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Predictable Seed in PRNG | - | - |
| The CERT Oracle Secure Coding Standard for Java (2011) | Generate strong random numbers | MSC02-J | - |

## Frequently asked questions

### What is CWE-337?

A Pseudo-Random Number Generator (PRNG) is initialized from a predictable seed, such as the process ID or system time.

### What CVEs are caused by CWE-337?

18 recorded CVEs are attributed to CWE-337, including CVE-2022-26852, CVE-2026-133185 and CVE-2022-40267.

### How do you prevent CWE-337?

Use non-predictable inputs for seed generation.

### How is CWE-337 detected?

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.)

### What are the consequences of CWE-337?

Exploiting CWE-337 can lead to: Bypass Protection Mechanism, Varies by Context.

### Is CWE-337 actively exploited?

18 recorded CVEs are caused by CWE-337; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/337.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-337). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
