---
title: "CWE-333: Improper Handling of Insufficient Entropy in TRNG"
url: https://radicalnotion.ai/cwe/cwe-333
type: cwe
description: "True random number generators (TRNG) generally have a limited source of entropy and therefore can fail or block."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-333: Improper Handling of Insufficient Entropy in TRNG

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

## Description

True random number generators (TRNG) generally have a limited source of entropy and therefore can fail or block.

## 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 |
| --- | --- | --- |
| Availability | DoS: Crash, Exit, or Restart | A program may crash or block if it runs out of random numbers. |

## Potential mitigations

### Implementation

Since the rate at which true random numbers can be generated is limited, it is important that one uses them only when they are needed for security.

### Implementation

Rather than failing on a lack of random numbers, it is often preferable to wait for more numbers to be created.

## Demonstrative examples

### Example 1

This code uses a TRNG to generate a unique session id for new connections to a server:

Bad code:

```c
while (1){
    if (haveNewConnection()){
        if (hwRandom()){
            int sessionID = hwRandom();
            createNewConnection(sessionID);
        } } }
```

This code does not attempt to limit the number of new connections or make sure the TRNG can successfully generate a new random number. An attacker may be able to create many new connections and exhaust the entropy of the TRNG. The TRNG may then block and cause the program to crash or hang.

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2025-62626 | - | high | 7.2 | - | No | 2025-11-21 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-331](https://radicalnotion.ai/cwe/cwe-331) | Insufficient Entropy |
| Parent | [CWE-755](https://radicalnotion.ai/cwe/cwe-755) | Improper Handling of Exceptional Conditions |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CLASP | Failure of TRNG | - | - |
| The CERT Oracle Secure Coding Standard for Java (2011) | Generate strong random numbers | MSC02-J | - |

## Frequently asked questions

### What is CWE-333?

True random number generators (TRNG) generally have a limited source of entropy and therefore can fail or block.

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

1 recorded CVE is attributed to CWE-333: CVE-2025-62626.

### How do you prevent CWE-333?

Since the rate at which true random numbers can be generated is limited, it is important that one uses them only when they are needed for security.

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

Exploiting CWE-333 can lead to: DoS: Crash, Exit, or Restart.

### Is CWE-333 actively exploited?

1 recorded CVE is caused by CWE-333; it is not currently in CISA's KEV catalog of actively exploited flaws.

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

---

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