---
title: "CWE-690: Unchecked Return Value to NULL Pointer Dereference"
url: https://radicalnotion.ai/cwe/cwe-690
type: cwe
description: "The product does not check for an error after calling a function that can return with a NULL pointer if the function fails, which leads to a resultant NULL pointer dereference."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-690: Unchecked Return Value to NULL Pointer Dereference

- **Abstraction:** Compound
- **Structure:** Chain
- **Status:** Draft
- **CVEs with this as primary weakness:** 27
- **Of those, in CISA KEV:** 1
- **New in 2026:** 3
- **CWE catalog version:** 4.21

## Description

The product does not check for an error after calling a function that can return with a NULL pointer if the function fails, which leads to a resultant NULL pointer dereference.

## Background

While unchecked return value weaknesses are not limited to returns of NULL pointers (see the examples in CWE-252), functions often return NULL to indicate an error status. When this error condition is not checked, a NULL pointer dereference can occur.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | A typical occurrence of this weakness occurs when an application includes user-controlled input to a malloc() call. The related code might be correct with respect to preventing buffer overflows, but if a large value is provided, the malloc() will fail due to insufficient memory. This problem also frequently occurs when a parsing routine expects that certain elements will always be present. If malformed input is provided, the parser might return NULL. For example, strtok() can return NULL. |

## Applicable platforms

**Languages:** Memory-Unsafe (Often), C (Undetermined), C++ (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Availability | DoS: Crash, Exit, or Restart | - |
| Integrity, Confidentiality, Availability | Execute Unauthorized Code or Commands, Read Memory, Modify Memory | In rare circumstances, when NULL is equivalent to the 0x0 memory address and privileged code can access it, then writing or reading memory is possible, which may lead to code execution. |

## Detection methods

### Black Box

This typically occurs in rarely-triggered error conditions, reducing the chances of detection during black box testing.

### White Box

Code analysis can require knowledge of API behaviors for library functions that might return NULL, reducing the chances of detection when unknown libraries are used.

### Automated Dynamic Analysis

Use tools that are integrated during compilation to insert runtime error-checking mechanisms related to memory safety errors, such as AddressSanitizer (ASan) for C/C++ \[REF-1518\].

Effectiveness: Moderate. Crafted inputs are necessary to reach the code containing the error, such as generated by fuzzers. Also, these tools may reduce performance, and they only report the error condition - not the original mistake that led to the error.

## Demonstrative examples

### Example 1

The code below makes a call to the getUserName() function but doesn't check the return value before dereferencing (which may cause a NullPointerException).

Bad code:

```java
String username = getUserName();
if (username.equals(ADMIN_USER)) {
    ...
}
```

### Example 2

This example takes an IP address from a user, verifies that it is well formed and then looks up the hostname and copies it into a buffer.

Bad code:

```c
void host_lookup(char *user_supplied_addr){
    struct hostent *hp;
    in_addr_t *addr;
    char hostname[64];
    in_addr_t inet_addr(const char *cp);

    /*routine that ensures user_supplied_addr is in the right format for conversion */

    validate_addr_form(user_supplied_addr);
    addr = inet_addr(user_supplied_addr);
    hp = gethostbyaddr( addr, sizeof(struct in_addr), AF_INET);
    strcpy(hostname, hp->h_name);
}
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2008-1052 | Large Content-Length value leads to NULL pointer dereference when malloc fails. |
| CVE-2006-6227 | Large message length field leads to NULL pointer dereference when malloc fails. |
| CVE-2006-2555 | Parsing routine encounters NULL dereference when input is missing a colon separator. |
| CVE-2003-1054 | URI parsing API sets argument to NULL when a parsing failure occurs, such as when the Referer header is missing a hostname, leading to NULL dereference. |
| CVE-2008-5183 | Chain: unchecked return value can lead to NULL dereference |

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-76418 | Cisco Secure Firewall Adaptive Security Appliance and Secure Firewall Threat Defense Software Remote Access SSL VPN Tunnel Denial of Service Vulnerability | high | 8.6 | - | Yes | 2026-10-28 |
| CVE-2022-20682 | Cisco IOS XE Wireless Controller Software for the Catalyst 9000 Family CAPWAP Denial of Service Vulnerability | high | 8.6 | - | No | 2022-04-15 |
| CVE-2026-87086 | Tanium addressed a denial of service vulnerability in Provision. | high | 7.5 | - | No | 2026-10-27 |
| CVE-2026-24160 | - | high | 7.5 | - | No | 2026-05-20 |
| CVE-2024-31196 | NULL Pointer Dereference in libfluid\_msg library | high | 7.5 | - | No | 2024-09-18 |
| CVE-2024-31185 | NULL Pointer Dereference in libfluid\_msg library | high | 7.5 | - | No | 2024-09-18 |
| CVE-2024-31182 | NULL Pointer Dereference in libfluid\_msg library | high | 7.5 | - | No | 2024-09-18 |
| CVE-2024-31175 | NULL Pointer Dereference in libfluid\_msg library | high | 7.5 | - | No | 2024-09-18 |
| CVE-2024-31167 | NULL Pointer Dereference in libfluid\_msg library | high | 7.5 | - | No | 2024-09-18 |
| CVE-2024-31165 | NULL Pointer Dereference in libfluid\_msg library | high | 7.5 | - | No | 2024-09-18 |
| CVE-2024-31164 | NULL Pointer Dereference in libfluid\_msg library | high | 7.5 | - | No | 2024-09-18 |
| CVE-2024-23916 | NULL Pointer Dereference in libfluid\_msg library | high | 7.5 | - | No | 2024-09-18 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-252](https://radicalnotion.ai/cwe/cwe-252) | Unchecked Return Value |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CERT C Secure Coding | Do not dereference null pointers | EXP34-C | CWE More Specific |
| The CERT Oracle Secure Coding Standard for Java (2011) | Do not catch NullPointerException or any of its ancestors | ERR08-J | - |
| SEI CERT Perl Coding Standard | Do not ignore function return values | EXP32-PL | CWE More Specific |

## Frequently asked questions

### What is CWE-690?

The product does not check for an error after calling a function that can return with a NULL pointer if the function fails, which leads to a resultant NULL pointer dereference.

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

27 recorded CVEs are attributed to CWE-690, including CVE-2026-76418, CVE-2022-20682 and CVE-2026-87086. 1 is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How is CWE-690 detected?

Black Box: This typically occurs in rarely-triggered error conditions, reducing the chances of detection during black box testing.

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

Exploiting CWE-690 can lead to: DoS: Crash, Exit, or Restart, Execute Unauthorized Code or Commands, Read Memory, Modify Memory.

### Is CWE-690 actively exploited?

Yes. 1 CWE-690 vulnerability is in CISA's KEV catalog of actively exploited flaws, out of 27 recorded CVEs.

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

---

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