---
title: "CWE-909: Missing Initialization of Resource"
url: https://radicalnotion.ai/cwe/cwe-909
type: cwe
description: "The product does not initialize a critical resource."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-909: Missing Initialization of Resource

- **Abstraction:** Class
- **Structure:** Simple
- **Status:** Incomplete
- **Likelihood of exploit:** Medium
- **CVEs with this as primary weakness:** 148
- **Of those, in CISA KEV:** 0
- **New in 2026:** 49
- **CWE catalog version:** 4.21

## Description

The product does not initialize a critical resource.

## Background

Many resources require initialization before they can be properly used.

## Modes of introduction

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

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Varies by Context | If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values. |
| Confidentiality | Read Memory, Read Application Data | When reusing a resource such as memory or a program variable, the original contents of that resource may not be cleared before it is sent to an untrusted party. |
| Availability | DoS: Crash, Exit, or Restart | The uninitialized resource may contain values that cause program flow to change in ways that the programmer did not intend. |

## Potential mitigations

### Implementation

Explicitly initialize the resource before use. If this is performed through an API function or standard procedure, follow all specified 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 your 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-2020-20739 | A variable that has its value set in a conditional statement is sometimes used when the conditional fails, sometimes causing data leakage |
| 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 |

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-98207 | mmc: spi: reset bytes\_xfered before retrying CRC failures | critical | 9.8 | - | No | 2026-10-06 |
| CVE-2022-22704 | - | critical | 9.8 | - | No | 2022-01-06 |
| CVE-2025-38120 | netfilter: nf\_set\_pipapo\_avx2: fix initial map fill | critical | 9.4 | - | No | 2025-07-03 |
| CVE-2026-43039 | net: ti: icssg-prueth: fix missing data copy and wrong recycle in ZC RX dispatch | critical | 9.3 | - | No | 2026-05-01 |
| CVE-2026-40687 | Exim: Exim: Denial of Service and Information Disclosure via SPA authentication driver vulnerability | critical | 9.1 | - | No | 2026-04-30 |
| CVE-2020-12523 | Phoenix Contact mGuard Devices versions before 8.8.3: LAN ports get functional after reboot even if they are disabled in the device configuration | critical | 9.1 | - | No | 2020-12-17 |
| CVE-2025-38601 | wifi: ath11k: clear initialized flag for deinit-ed srng lists | high | 8.8 | - | No | 2025-08-19 |
| CVE-2025-38293 | wifi: ath11k: fix node corruption in ar-\>arvifs list | high | 8.8 | - | No | 2025-07-10 |
| CVE-2021-29980 | Mozilla: Uninitialized memory in a canvas object could have led to memory corruption | high | 8.8 | - | No | 2021-08-17 |
| CVE-2021-23994 | Mozilla: Out of bound write due to lazy initialization | high | 8.8 | - | No | 2021-06-24 |
| CVE-2020-11741 | xen: xenoprof issue allows guest OS users with active profiling to obtain sensitive information about other guests (XSA-313) | high | 8.8 | - | No | 2020-04-14 |
| CVE-2025-8117 | Account Takeover via Reset Password Functionality in PAD CMS | high | 8.7 | - | No | 2025-09-30 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-665](https://radicalnotion.ai/cwe/cwe-665) | Improper Initialization |
| Child | [CWE-456](https://radicalnotion.ai/cwe/cwe-456) | Missing Initialization of a Variable |
| Child | [CWE-1271](https://radicalnotion.ai/cwe/cwe-1271) | Uninitialized Value on Reset for Registers Holding Security Settings |
| Can precede | [CWE-908](https://radicalnotion.ai/cwe/cwe-908) | Use of Uninitialized Resource |

## Frequently asked questions

### What is CWE-909?

The product does not initialize a critical resource.

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

148 recorded CVEs are attributed to CWE-909, including CVE-2026-98207, CVE-2022-22704 and CVE-2025-38120.

### How do you prevent CWE-909?

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

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

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

### Is CWE-909 actively exploited?

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

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

---

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