---
title: "CWE-334: Small Space of Random Values"
url: https://radicalnotion.ai/cwe/cwe-334
type: cwe
description: "The number of possible random values is smaller than needed by the product, making it more susceptible to brute force attacks."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-334: Small Space of Random Values

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

## Description

The number of possible random values is smaller than needed by the product, making it more susceptible to brute force attacks.

## Modes of introduction

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

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control, Other | Bypass Protection Mechanism, Other | An attacker could easily guess the values used. This could lead to unauthorized access to a system if the seed is used for authentication and authorization. |

## Potential mitigations

### Architecture and Design, Requirements (Libraries or Frameworks)

Use products or modules that conform to FIPS 140-2 \[REF-267\] to avoid obvious entropy problems. Consult FIPS 140-2 Annex C ("Approved Random Number Generators").

## Demonstrative examples

### Example 1

The following XML example code is a deployment descriptor for a Java web application deployed on a Sun Java Application Server. This deployment descriptor includes a session configuration property for configuring the session ID length.

Bad code:

```xml
<sun-web-app>
    ...
    <session-config>
        <session-properties>
            <property name="idLengthBytes" value="8">
                <description>The number of bytes in this web module's session ID.</description>
            </property>
        </session-properties>
    </session-config>
    ...
</sun-web-app>
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2002-0583 | Product uses 5 alphanumeric characters for filenames of expense claim reports, stored under web root. |
| CVE-2002-0903 | Product uses a small number of random numbers for a code to approve an action, and also uses predictable new user IDs, allowing attackers to hijack new accounts. |
| CVE-2003-1230 | SYN cookies implementation only uses 32-bit keys, making it easier to brute force ISN. |
| CVE-2004-0230 | Complex predictability / randomness (reduced space). |

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2023-39979 | MXsecurity Authentication Bypass | critical | 9.8 | - | No | 2023-09-02 |
| CVE-2023-1898 | CVE-2023-1898 | critical | 9.4 | - | No | 2023-06-12 |
| CVE-2025-3895 | Low token entropy in MegaBIP | critical | 9.1 | - | No | 2025-05-23 |
| CVE-2022-24402 | Intentionally weakened effective strength in TETRA TEA1 | high | 8.8 | - | No | 2023-10-19 |
| CVE-2022-22517 | Communication Components in multiple CODESYS products vulnerable to communication channel disruption | high | 7.5 | - | No | 2022-04-07 |
| CVE-2021-21955 | Anker Eufy Homebase 2 home\_security get\_aes\_key\_info\_by\_packetid() authentication bypass vulnerability | high | 7.5 | - | No | 2021-12-09 |
| CVE-2026-122118 | - | high | 7.4 | - | No | 2026-11-04 |
| CVE-2020-7566 | Small Space of Random Values in Schneider Electric Modicon M221 Programmable Logic Controller | high | 7.3 | - | No | 2020-11-19 |
| CVE-2024-54017 | Small Space of Random Values in Siemens SIPROTEC 5 | medium | 6.9 | - | No | 2026-05-12 |
| CVE-2023-6951 | - | medium | 6.6 | - | No | 2024-04-02 |
| CVE-2026-129144 | paicoding 1.0.3 Payment Bypass via Guessable Codes in /article/api/pay/callback | medium | 5.3 | - | No | 2026-11-13 |
| CVE-2024-52616 | Avahi: avahi wide-area dns predictable transaction ids | medium | 5.3 | - | No | 2024-11-21 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-330](https://radicalnotion.ai/cwe/cwe-330) | Use of Insufficiently Random Values |
| Child | [CWE-6](https://radicalnotion.ai/cwe/cwe-6) | J2EE Misconfiguration: Insufficient Session-ID Length |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Small Space of Random Values | - | - |

## Frequently asked questions

### What is CWE-334?

The number of possible random values is smaller than needed by the product, making it more susceptible to brute force attacks.

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

15 recorded CVEs are attributed to CWE-334, including CVE-2023-39979, CVE-2023-1898 and CVE-2025-3895.

### How do you prevent CWE-334?

Use products or modules that conform to FIPS 140-2 to avoid obvious entropy problems. Consult FIPS 140-2 Annex C ("Approved Random Number Generators").

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

Exploiting CWE-334 can lead to: Bypass Protection Mechanism, Other.

### Is CWE-334 actively exploited?

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

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

---

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