---
title: "CWE-908: Use of Uninitialized Resource"
url: https://radicalnotion.ai/cwe/cwe-908
type: cwe
description: "The product uses or accesses a resource that has not been initialized."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-908: Use of Uninitialized Resource

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **Likelihood of exploit:** Medium
- **CVEs with this as primary weakness:** 1,128
- **Of those, in CISA KEV:** 2
- **New in 2026:** 511
- **CWE catalog version:** 4.21

## Description

The product uses or accesses a resource that has not been initialized.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Read Memory, Read Application Data | When reusing a resource such as memory or a program variable, the original contents may not have been cleared before it is sent to an untrusted party. |
| Availability | DoS: Crash, Exit, or Restart, DoS: Instability | The uninitialized resource may contain values that cause program flow to change in ways that the programmer did not intend, possibly leading to a crash. |
| Other | Unexpected State, Varies by Context | The consequences vary depending on the type of resource and how it is used within the product. |

## Potential mitigations

### Implementation

Explicitly initialize the resource before use. If this is performed through an API function or standard procedure, follow all required steps.

### Implementation

Pay close attention to complex conditionals that affect initialization, since some branches might not perform the initialization.

### Implementation

Avoid race conditions (CWE-362) during initialization routines.

### Build and Compilation

Run or compile the product with settings that generate warnings about uninitialized variables or data.

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

Effectiveness: High

## Demonstrative examples

### Example 1

Here, a boolean initialized field is consulted to ensure that initialization tasks are only completed once. However, the field is mistakenly set to true during static initialization, so the initialization code is never reached.

Bad code:

```java
private boolean initialized = true;
public void someMethod() {
    if (!initialized) {

        // perform initialization tasks
        ...

        initialized = true;
    }
```

### Example 2

The following code intends to limit certain operations to the administrator only.

Bad code:

```perl
$username = GetCurrentUser();
$state = GetStateData($username);
if (defined($state)) {
    $uid = ExtractUserID($state);
}

# do stuff
if ($uid == 0) {
    DoAdminThings();
}
```

If the application is unable to extract the state information - say, due to a database timeout - then the $uid variable will not be explicitly set by the programmer. This will cause $uid to be regarded as equivalent to "0" in the conditional, allowing the original user to perform administrator actions. Even if the attacker cannot directly influence the state data, unexpected errors could cause incorrect privileges to be assigned to a user just by accident.

### Example 3

The following code intends to concatenate a string to a variable and print the string.

Bad code:

```c
char str[20];
strcat(str, "hello world");
printf("%s", str);
```

### Example 4

This example will leave test\_string in an unknown condition when i is the same value as err\_val, because test\_string is not initialized (CWE-456). Depending on where this code segment appears (e.g. within a function body), test\_string might be random if it is stored on the heap or stack. If the variable is declared in static memory, it might be zero or NULL. Compiler optimization might contribute to the unpredictability of this address.

Bad code:

```c
char *test_string;
if (i != err_val)
{
    test_string = "Hello World!";
}
printf("%s", test_string);
```

Good code:

```c
char *test_string = "Done at the beginning";
if (i != err_val)
{
    test_string = "Hello World!";
}
printf("%s", test_string);
```

Good code:

```c
char *test_string;
if (i != err_val)
{
    test_string = "Hello World!";
}
else {
    test_string = "Done on the other side!";
}
printf("%s", test_string);
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2019-9805 | Chain: Creation of the packet client occurs before initialization is complete (CWE-696) resulting in a read from uninitialized memory (CWE-908), causing memory corruption. |
| CVE-2008-4197 | Use of uninitialized memory may allow code execution. |
| CVE-2008-2934 | Free of an uninitialized pointer leads to crash and possible code execution. |
| CVE-2008-0063 | Product does not clear memory contents when generating an error message, leading to information leak. |
| CVE-2008-0062 | Lack of initialization triggers NULL pointer dereference or double-free. |
| CVE-2008-0081 | Uninitialized variable leads to code execution in popular desktop application. |
| CVE-2008-3688 | Chain: Uninitialized variable leads to infinite loop. |
| CVE-2008-3475 | Chain: Improper initialization leads to memory corruption. |
| CVE-2005-1036 | Chain: Bypass of access restrictions due to improper authorization (CWE-862) of a user results from an improperly initialized (CWE-909) I/O permission bitmap |
| CVE-2008-3597 | Chain: game server can access player data structures before initialization has happened leading to NULL dereference |
| CVE-2009-2692 | Chain: Use of an unimplemented network socket operation pointing to an uninitialized handler function (CWE-456) causes a crash because of a null pointer dereference (CWE-476). |
| CVE-2009-0949 | Chain: improper initialization of memory can lead to NULL dereference |
| CVE-2009-3620 | Chain: some unprivileged ioctls do not verify that a structure has been initialized before invocation, leading to NULL dereference |
| CVE-2008-5021 | Composite: race condition (CWE-362) allows attacker to modify an object while it is still being initialized, causing software to access uninitialized memory (CWE-908). |

## Real CVEs with this weakness (sample of 12 of 1,128)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2024-50302 | HID: core: zero-initialize the report buffer | medium | 6.8 | - | Yes | 2024-11-19 |
| CVE-2024-29745 | Android Pixel Information Disclosure Vulnerability | medium | 6.8 | - | Yes | 2024-04-05 |
| CVE-2025-38429 | bus: mhi: ep: Update read pointer only after buffer is written | critical | 10.0 | - | No | 2025-07-25 |
| CVE-2026-99687 | vhost-scsi: zero misaligned I/O bounce pages | critical | 9.8 | - | No | 2026-11-20 |
| CVE-2026-99356 | SUNRPC: Do not credit control-record octets to the RPC stream | critical | 9.8 | - | No | 2026-11-19 |
| CVE-2026-98345 | wifi: cfg80211: check IP header size in cfg80211\_classify8021d() | critical | 9.8 | - | No | 2026-10-06 |
| CVE-2026-98322 | netfilter: nft\_nat: fully initialise new\_addr in netmap setup | critical | 9.8 | - | No | 2026-10-06 |
| CVE-2026-98263 | ASoC: codecs: rt712-sdca-dmic: fix uninitialized stream\_config-\>type | critical | 9.8 | - | No | 2026-10-06 |
| CVE-2026-74617 | dibs: initialise dibs-\>lock in dibs\_dev\_alloc() | critical | 9.8 | - | No | 2026-08-22 |
| CVE-2026-63857 | net: airoha: Do not read uninitialized fragment address in airoha\_dev\_xmit() | critical | 9.8 | - | No | 2026-07-19 |
| CVE-2026-56190 | Remote Desktop Protocol Remote Code Execution Vulnerability | critical | 9.8 | - | No | 2026-07-14 |
| CVE-2022-50335 | 9p: set req refcount to zero to avoid uninitialized usage | critical | 9.8 | - | No | 2025-09-15 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-665](https://radicalnotion.ai/cwe/cwe-665) | Improper Initialization |
| Child | [CWE-457](https://radicalnotion.ai/cwe/cwe-457) | Use of Uninitialized Variable |
| Related | [CWE-909](https://radicalnotion.ai/cwe/cwe-909) | Missing Initialization of Resource |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CERT C Secure Coding | Do not read uninitialized memory | EXP33-C | CWE More Abstract |

## Frequently asked questions

### What is CWE-908?

The product uses or accesses a resource that has not been initialized.

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

1,128 recorded CVEs are attributed to CWE-908, including CVE-2024-50302, CVE-2024-29745 and CVE-2025-38429. 2 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-908?

Explicitly initialize the resource before use. If this is performed through an API function or standard procedure, follow all required steps.

### How is CWE-908 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-908?

Exploiting CWE-908 can lead to: Read Memory, Read Application Data, DoS: Crash, Exit, or Restart, DoS: Instability, Unexpected State, Varies by Context.

### Is CWE-908 actively exploited?

Yes. 2 CWE-908 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 1,128 recorded CVEs.

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

---

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